-
Notifications
You must be signed in to change notification settings - Fork 13
215 lines (174 loc) · 8.8 KB
/
cucumber-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
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
name: Cucumber Tests
on:
pull_request:
branches: [ master ]
push:
branches: [ master ]
workflow_dispatch:
jobs:
efiling-api-gcr:
name: Efiling Api GCR
runs-on: ubuntu-latest
steps:
- name: Pull Git repo.
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
registry: docker.pkg.github.com
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull efiling-api-builder
run: docker pull docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-api:builder || true
- name: build efiling-api-builder
run: docker build ./src/backend
-f ./src/backend/Dockerfile.efiling-api
--target build
-t efiling-api:builder
--build-arg SERVICE_NAME=efiling-api
--build-arg MVN_PROFILE=efiling-api-demo
--build-arg STARTERS_V=v1.0.2
--cache-from=docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-api:builder
- name: tag & push efiling-api to git container registry
if: github.event.pull_request.head.repo.full_name == github.repository
run: docker tag efiling-api:builder docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-api:builder && docker push docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-api:builder
- name: Pull efiling-api-demo
run: docker pull docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-api:demo || true
- name: build efiling-api-demo
run: docker build ./src/backend
-f ./src/backend/Dockerfile.efiling-api
-t efiling-api:demo
--build-arg SERVICE_NAME=efiling-api
--build-arg MVN_PROFILE=efiling-api-demo
--build-arg STARTERS_V=v1.0.2
--cache-from=docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-api:builder
--cache-from=docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-api:demo
# Optional only for branch on repo
- name: tag & push efiling-api to git container registry
if: github.event.pull_request.head.repo.full_name == github.repository
run: docker tag efiling-api:demo docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-api:demo && docker push docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-api:demo
efiling-frontend-gcr:
name: Efiling Frontend GCR
runs-on: ubuntu-latest
steps:
- name: Pull Git repo.
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
registry: docker.pkg.github.com
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull efiling-frontend-builder
run: docker pull docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-frontend:builder || true
- name: build efiling-frontend-builder
run: docker build ./src/frontend/efiling-frontend
--target build
-t efiling-frontend:builder
--cache-from=docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-frontend:builder
- name: tag & push efiling-frontend to git container registry
if: github.event.pull_request.head.repo.full_name == github.repository
run: docker tag efiling-frontend:builder docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-frontend:builder && docker push docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-frontend:builder
- name: Pull efiling-frontend-demo
run: docker pull docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-frontend:demo || true
- name: build efiling-frontend-demo
run: docker build ./src/frontend/efiling-frontend
-t efiling-frontend:demo
--cache-from=docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-frontend:builder
--cache-from=docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-frontend:demo
- name: tag & push efiling-frontend to git container registry
if: github.event.pull_request.head.repo.full_name == github.repository
run: docker tag efiling-frontend:demo docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-frontend:demo && docker push docker.pkg.github.com/$GITHUB_REPOSITORY/efiling-frontend:demo
keycloak-config-gcr:
name: Keycloack Config GCR
runs-on: ubuntu-latest
steps:
- name: Pull Git repo.
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
registry: docker.pkg.github.com
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull efiling-frontend-builder
run: docker pull docker.pkg.github.com/$GITHUB_REPOSITORY/keycloak-config:demo || true
- name: build efiling-frontend-builder
run: docker build ./infrastructure/keycloak
-t keycloak-config:demo
--build-arg KEYCLOAK_URL=http://keycloak:8080
--cache-from=docker.pkg.github.com/$GITHUB_REPOSITORY/keycloak-config:demo
- name: tag & push keycloak-config to git container registry
if: github.event.pull_request.head.repo.full_name == github.repository
run: docker tag keycloak-config:demo docker.pkg.github.com/$GITHUB_REPOSITORY/keycloak-config:demo && docker push docker.pkg.github.com/$GITHUB_REPOSITORY/keycloak-config:demo
cucumber-tests:
name: Runs cucumber-tests
runs-on: ubuntu-latest
needs: [ efiling-api-gcr, efiling-frontend-gcr, keycloak-config-gcr ]
steps:
- name: Pull Git repo.
uses: actions/checkout@v2
# pulling images is faster than caching in most of the case
- name: pull available docker images first
run: docker compose pull -q --parallel redis clamav keycloak
- name: Standup Infra
run: docker compose up -d redis clamav keycloak
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
registry: docker.pkg.github.com
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Pull images (Local REPO only)
if: github.event.pull_request.head.repo.full_name == github.repository
run: docker compose -f docker-compose.yml -f tests/docker-compose-integration.yml pull --parallel -q efiling-api efiling-frontend keycloak-config
- name: Standup Docker Pods (Local REPO only)
if: github.event.pull_request.head.repo.full_name == github.repository
run: docker compose -f docker-compose.yml -f tests/docker-compose-integration.yml up -d efiling-api efiling-frontend
- name: Standup Docker Pods (FORK only)
if: github.event.pull_request.head.repo.full_name != github.repository
run: docker compose up -d efiling-api efiling-frontend
- name: Configure keycloak (Local REPO only)
if: github.event.pull_request.head.repo.full_name == github.repository
run: |
docker compose -f docker-compose.yml -f tests/docker-compose-integration.yml up keycloak-config
- name: Configure keycloak (FORK only)
if: github.event.pull_request.head.repo.full_name != github.repository
run: |
docker compose up keycloak-config
- name: Running Integration Tests
env:
DOCKERIZE_VERSION: v0.6.1
continue-on-error: true
id: cucumber-test
run: |
# Maven requires chrome driver.
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt-get -qq -y install ./google-chrome-stable_current_amd64.deb
# We need to test if efiling-api pod and service is running before we can proceed. Using dockerize to proceed only after efiling-demo:8080 can be reached.
wget -q https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
tar -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
./dockerize -wait http://127.0.0.1:8080/actuator/health -timeout 120s
mvn verify -ntp -f tests/pom.xml
# Upload Spark report for debugging purposes
- name: Upload Spark report for debugging purposes
uses: actions/upload-artifact@v4
with:
name: cucumber-spark-report
path: ./tests/test-output/extent/Spark/Index.html
# Upload Cucumber JSON for debugging purposes
- name: Upload Cucumber JSON for debugging purposes
uses: actions/upload-artifact@v4
with:
name: cucumber-json-report
path: ./tests/target/cucumber-reports/CucumberTestReport.json
- name: Set action status
if: steps.cucumber-test.outcome != 'success'
run: exit 1