-
Notifications
You must be signed in to change notification settings - Fork 40
73 lines (69 loc) · 2.6 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: test
on:
push:
branches:
- '**'
tags-ignore:
- '**'
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_USER: enricher
POSTGRES_PASSWORD: supersecret1
POSTGRES_DB: sql_enrichment_test
POSTGRES_PORT: 5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v2
- uses: coursier/cache-action@v6
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Start HTTP server to test API enrichment in Common Enrich
run: python integration-tests/common/api-enrichment-test.py 8001 &
- name: Start HTTP server to test API enrichment in Common Fs2
run: python integration-tests/common-fs2/api-enrichment-test.py 8000 &
- name: Prepare data in Postgres to test SQL enrichment in Common Enrich
run: psql -h localhost -p 5432 -U enricher -d sql_enrichment_test < integration-tests/common/sql-enrichment-test.sql
env:
PGPASSWORD: supersecret1
- name: Prepare data in Postgres to test SQL enrichment in Common Fs2
run: psql -h localhost -p 5432 -U enricher -d sql_enrichment_test < integration-tests/common-fs2/sql-enrichment-test.sql
env:
PGPASSWORD: supersecret1
- name: Run tests
run: SBT_OPTS="-Xms1G -Xmx8G -Xss4M -XX:MaxMetaspaceSize=1024M" TESTCONTAINERS_RYUK_DISABLED=true sbt coverage +test
env:
OER_KEY: ${{ secrets.OER_KEY }}
- name: Check Scala formatting
run: sbt scalafmtCheckAll
- name: Check assets can be published
run: sbt publishLocal
- name: Run integration tests for enrich-kinesis
run: sbt "project kinesisDistroless" IntegrationTest/test
env:
AWS_ACCESS_KEY_ID: foo
AWS_SECRET_ACCESS_KEY: bar
- name: Run integration tests for enrich-kafka
run: |
sbt "project kafka" "docker:publishLocal"
docker-compose -f integration-tests/enrich-kafka/docker-compose.yml up -d
sbt "project kafka" IntegrationTest/test
docker-compose -f integration-tests/enrich-kafka/docker-compose.yml down
- name: Run integration tests for enrich-nsq
run: sbt "project nsqDistroless" IntegrationTest/test
- name: Generate coverage report
run: sbt coverageReport
- name: Aggregate coverage data
run: sbt coverageAggregate
- name: Submit coveralls data
run: sbt coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}