-
Notifications
You must be signed in to change notification settings - Fork 21
107 lines (103 loc) · 3.08 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Test
on:
pull_request:
branches:
- develop
push:
branches:
- develop
tags:
- v*
env:
AERIE_USERNAME: "${{secrets.AERIE_USERNAME}}"
AERIE_PASSWORD: "${{secrets.AERIE_PASSWORD}}"
HASURA_GRAPHQL_ADMIN_SECRET: "${{secrets.HASURA_GRAPHQL_ADMIN_SECRET}}"
HASURA_GRAPHQL_JWT_SECRET: "${{secrets.HASURA_GRAPHQL_JWT_SECRET}}"
POSTGRES_USER: "${{secrets.POSTGRES_USER}}"
POSTGRES_PASSWORD: "${{secrets.POSTGRES_PASSWORD}}"
jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "19"
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Assemble
run: ./gradlew assemble --parallel
- name: Run Unit Tests
run: ./gradlew test --parallel
- name: Upload Test Results as XML
if: always()
uses: actions/upload-artifact@v3
with:
name: Test Results
path: "**/build/test-results/test"
- name: Upload Test Results as HTML
if: always()
uses: actions/upload-artifact@v3
with:
name: Test Results
path: "**/build/reports/tests/test"
e2e-test:
runs-on: ubuntu-latest
environment: e2e-test
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "19"
- name: Setup Postgres Client (psql)
run: |
sudo apt-get update
sudo apt-get install --yes postgresql-client
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Assemble
run: ./gradlew assemble --parallel
- name: Start Services
run: |
docker compose -f ./e2e-tests/docker-compose-test.yml up -d --build
docker images
docker ps -a
- name: Sleep for 30 Seconds
run: sleep 30s
shell: bash
- name: Run E2E Tests
run: ./gradlew e2eTest
- name: Upload E2E Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: Test Results
path: "**/e2e-tests/test-results"
- name: Upload Sequencing Server Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: Test Results
path: "**/sequencing-server/test-report.*"
- name: Print Logs for Services
if: always()
run: docker compose -f ./e2e-tests/docker-compose-test.yml logs -t
- name: Stop Services
if: always()
run: |
docker ps -a
docker compose -f ./e2e-tests/docker-compose-test.yml down
docker ps -a
- name: Prune Volumes
if: always()
run: docker volume prune --force