-
Notifications
You must be signed in to change notification settings - Fork 29
191 lines (184 loc) · 6.36 KB
/
test.yml
File metadata and controls
191 lines (184 loc) · 6.36 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: Test
on:
pull_request:
branches:
- develop
- dev-[0-9]+.[0-9]+.[0-9]+
types:
# defaults + 'edited', to handle changes to flags like ___REQUIRES_GATEWAY_PR___ in the PR body
[ opened, synchronize, reopened, edited ]
push:
branches:
- develop
tags:
- v*
workflow_dispatch:
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}}"
GATEWAY_USERNAME: "${{secrets.GATEWAY_USERNAME}}"
GATEWAY_PASSWORD: "${{secrets.GATEWAY_PASSWORD}}"
MERLIN_USERNAME: "${{secrets.MERLIN_USERNAME}}"
MERLIN_PASSWORD: "${{secrets.MERLIN_PASSWORD}}"
SCHEDULER_USERNAME: "${{secrets.SCHEDULER_USERNAME}}"
SCHEDULER_PASSWORD: "${{secrets.SCHEDULER_PASSWORD}}"
SEQUENCING_USERNAME: "${{secrets.SEQUENCING_USERNAME}}"
SEQUENCING_PASSWORD: "${{secrets.SEQUENCING_PASSWORD}}"
PR_BODY: "${{github.event.pull_request.body}}"
jobs:
unit-test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v6
- name: Load NPM Cache
uses: ./.github/actions/load-node-cache
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: "temurin"
java-version: "21"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
# This action defaults to matching on "main" and "master" as the branches allowed to write to the cache
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
- name: Assemble
# Don't generate docs for tests
run: ./gradlew assemble -x javadoc -x javadocJar -x generateDocumentation --parallel
- name: Run Unit Tests
run: ./gradlew test --parallel
- name: Upload Test Results as XML and HTML
if: always()
uses: actions/upload-artifact@v7
with:
name: Unit Test Results
path: |
**/build/test-results/test
**/build/reports/tests/test
action-unit-tests:
runs-on: ubuntu-latest
environment: e2e-test
steps:
- name: Checkout Repo
uses: actions/checkout@v6
- name: Setup NPM
uses: actions/setup-node@v6
with:
node-version-file: ./action-server/.nvmrc
cache: npm
cache-dependency-path: ./action-server/package-lock.json
- name: Install Dependencies
run: npm ci
working-directory: ./action-server
- name: Run Action Server Unit Tests
run: npm --silent run test
working-directory: ./action-server
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v7
with:
name: Action Server Test Results
path: |
**/action-server/action-server-test-report.log
db-tests:
runs-on: ubuntu-latest
environment: e2e-test
steps:
- name: Checkout Repo
uses: actions/checkout@v6
- name: Setup Postgres Client (psql)
run: |
sudo apt-get update
sudo apt-get install --yes postgresql-client
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: "temurin"
java-version: "21"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
# This action defaults to matching on "main" and "master" as the branches allowed to write to the cache
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
- name: Start Services
run: |
docker compose -f ./e2e-tests/docker-compose-test.yml up postgres -d --quiet-pull
- name: Sleep for 5 Seconds
run: sleep 5s
shell: bash
- name: Run DB Tests
run: ./gradlew db-tests:e2eTest
- name: Upload DB Test Results
if: always()
uses: actions/upload-artifact@v7
with:
name: DB Test Results
path: |
**/db-tests/build/reports/tests/e2eTest
- name: Shutdown Backend
uses: ./.github/actions/shutdown-test-backend
sequencing-e2e-tests:
runs-on: ubuntu-latest
environment: e2e-test
steps:
- name: Checkout Repo
uses: actions/checkout@v6
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: "temurin"
java-version: "21"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
# This action defaults to matching on "main" and "master" as the branches allowed to write to the cache
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
- name: Start E2E Test Backend
uses: ./.github/actions/start-test-backend
- name: Run Sequencing E2E Tests
run: ./gradlew sequencing-server:e2eTest
- name: Upload Sequencing E2E Test Results
if: always()
uses: actions/upload-artifact@v7
with:
name: Sequencing E2E Test Results
path: |
**/sequencing-server/test-report.*
- name: Shutdown E2E Test Backend
uses: ./.github/actions/shutdown-test-backend
java-e2e-test:
runs-on: ubuntu-latest
environment: e2e-test
steps:
- name: Checkout Repo
uses: actions/checkout@v6
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: "temurin"
java-version: "21"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
# This action defaults to matching on "main" and "master" as the branches allowed to write to the cache
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
- name: Start E2E Test Backend
uses: ./.github/actions/start-test-backend
- name: Build scheduling procedure jars for testing
run: ./gradlew e2e-tests:buildAllProcedureJars
- name: Run E2E Tests
run: ./gradlew e2e-tests:e2eTest
- name: Upload E2E Test Results
if: always()
uses: actions/upload-artifact@v7
with:
name: E2E Test Results
path: |
**/e2e-tests/build/reports/tests/e2eTest
- name: Shutdown Backend
uses: ./.github/actions/shutdown-test-backend