|
1 | | -name: CI |
| 1 | +name: release |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | tags: |
6 | 6 | - '*' |
7 | 7 | branches: |
8 | | - - master |
9 | | - - develop |
10 | 8 | - 'snapshot/**' |
11 | | - pull_request: |
12 | 9 |
|
13 | 10 | jobs: |
14 | | - test: |
15 | | - runs-on: ubuntu-latest |
16 | | - |
17 | | - services: |
18 | | - postgres: |
19 | | - image: postgres |
20 | | - ports: |
21 | | - - 5432:5432 |
22 | | - env: |
23 | | - POSTGRES_USER: enricher |
24 | | - POSTGRES_PASSWORD: supersecret1 |
25 | | - POSTGRES_DB: sql_enrichment_test |
26 | | - POSTGRES_PORT: 5432 |
27 | | - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 |
28 | | - |
29 | | - steps: |
30 | | - - uses: actions/checkout@v2 |
31 | | - - uses: coursier/cache-action@v6 |
32 | | - - name: Set up JDK 11 |
33 | | - uses: actions/setup-java@v1 |
34 | | - with: |
35 | | - java-version: 11 |
36 | | - - name: Start HTTP server to test API enrichment in Common Enrich |
37 | | - run: python integration-tests/common/api-enrichment-test.py 8001 & |
38 | | - - name: Start HTTP server to test API enrichment in Common Fs2 |
39 | | - run: python integration-tests/common-fs2/api-enrichment-test.py 8000 & |
40 | | - - name: Prepare data in Postgres to test SQL enrichment in Common Enrich |
41 | | - run: psql -h localhost -p 5432 -U enricher -d sql_enrichment_test < integration-tests/common/sql-enrichment-test.sql |
42 | | - env: |
43 | | - PGPASSWORD: supersecret1 |
44 | | - - name: Prepare data in Postgres to test SQL enrichment in Common Fs2 |
45 | | - run: psql -h localhost -p 5432 -U enricher -d sql_enrichment_test < integration-tests/common-fs2/sql-enrichment-test.sql |
46 | | - env: |
47 | | - PGPASSWORD: supersecret1 |
48 | | - - name: Run tests |
49 | | - run: SBT_OPTS="-Xms1G -Xmx8G -Xss4M -XX:MaxMetaspaceSize=1024M" sbt coverage +test |
50 | | - env: |
51 | | - OER_KEY: ${{ secrets.OER_KEY }} |
52 | | - - name: Check Scala formatting |
53 | | - run: sbt scalafmtCheckAll |
54 | | - - name: Check assets can be published |
55 | | - run: sbt publishLocal |
56 | | - - name: Run integration tests for enrich-kinesis |
57 | | - run: sbt "project kinesisDistroless" IntegrationTest/test |
58 | | - env: |
59 | | - AWS_ACCESS_KEY_ID: foo |
60 | | - AWS_SECRET_ACCESS_KEY: bar |
61 | | - - name: Run integration tests for enrich-kafka |
62 | | - run: | |
63 | | - sbt "project kafka" "docker:publishLocal" |
64 | | - docker-compose -f integration-tests/enrich-kafka/docker-compose.yml up -d |
65 | | - sbt "project kafka" IntegrationTest/test |
66 | | - docker-compose -f integration-tests/enrich-kafka/docker-compose.yml down |
67 | | - - name: Run integration tests for enrich-nsq |
68 | | - run: sbt "project nsqDistroless" IntegrationTest/test |
69 | | - - name: Generate coverage report |
70 | | - run: sbt coverageReport |
71 | | - - name: Aggregate coverage data |
72 | | - run: sbt coverageAggregate |
73 | | - - name: Submit coveralls data |
74 | | - run: sbt coveralls |
75 | | - env: |
76 | | - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
77 | | - |
78 | 11 | github_release: |
79 | | - needs: test |
80 | 12 | if: startsWith(github.ref, 'refs/tags/') |
81 | 13 | runs-on: ubuntu-latest |
82 | 14 | steps: |
|
119 | 51 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
120 | 52 |
|
121 | 53 | publish_docker: |
122 | | - needs: test |
123 | 54 | if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/snapshot') |
124 | 55 | runs-on: ubuntu-latest |
125 | 56 | strategy: |
@@ -247,7 +178,6 @@ jobs: |
247 | 178 | SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} |
248 | 179 |
|
249 | 180 | publish_sce: |
250 | | - needs: test |
251 | 181 | if: startsWith(github.ref, 'refs/tags/') |
252 | 182 | runs-on: ubuntu-latest |
253 | 183 | steps: |
|
0 commit comments