forked from dhis2/dhis2-core
-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (39 loc) · 1.17 KB
/
run-api-tests.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
name: Run api tests
on:
pull_request:
types: [ labeled, synchronize ]
concurrency:
group: ${{ github.workflow}}-${{ github.ref }}
cancel-in-progress: true
jobs:
api-test:
env:
CORE_IMAGE_NAME: "dhis2/core:local"
TEST_IMAGE_NAME: "dhis2/tests:local"
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.labels.*.name, 'skip-api-tests')"
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Build core image
run: |
bash ./dhis-2/build-dev.sh
- name: Run tests
run: |
cd dhis-2/dhis-e2e-test
IMAGE_NAME=$CORE_IMAGE_NAME docker-compose up -d
docker build -t $TEST_IMAGE_NAME .
IMAGE_NAME=$TEST_IMAGE_NAME docker-compose -f docker-compose.e2e.yml up --exit-code-from e2e-test
- name: Upload logs
if: failure()
run: |
cd dhis-2/dhis-e2e-test
docker-compose logs web > ~/logs.txt
- uses: actions/upload-artifact@v2
if: failure()
with:
name: "tomcat_logs"
path: '~/logs.txt'