-
Notifications
You must be signed in to change notification settings - Fork 0
243 lines (231 loc) · 7.8 KB
/
ci.yaml
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
name: CI Pipeline
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
push:
branches:
- master
tags:
- '*'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Read .nvmrc
run: echo "NVMRC=$(cat .nvmrc)" >> $GITHUB_OUTPUT
id: nvm
- name: Use Node.js (.nvmrc)
uses: actions/setup-node@v4
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
cache: yarn
- name: yarn install
run: yarn
- name: Lint
run: yarn lint
- name: install browsers
run: yarn playwright install chromium
- name: Pull images
run: docker compose pull --quiet
- name: Bring up EPP
run: docker compose up --wait
- name: Docker compose status
if: failure()
run: |
docker compose ps
echo "Docker logs for minio"
echo ""
docker compose logs minio
echo ""
echo "Docker logs for createbucket"
echo ""
docker compose logs createbucket
echo ""
echo "Docker logs for loadbucket"
echo ""
docker compose logs loadbucket
echo ""
echo "Docker logs for temporal"
echo ""
docker compose logs temporal
echo ""
echo "Docker logs for mongodb"
echo ""
docker compose logs mongodb
echo ""
echo "Docker logs for api"
echo ""
docker compose logs api
echo ""
echo "Docker logs for client"
echo ""
docker compose logs client
echo ""
echo "Docker logs for xslt"
echo ""
docker compose logs xslt
echo ""
echo "Docker logs for worker"
echo ""
docker compose logs worker
echo ""
echo "Docker logs for wiremock"
echo ""
docker compose logs wiremock
echo ""
- name: run tests
run: yarn test --workers 5
- name: Playwright report upload
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/index.html
- name: Failure Slack Notification
uses: slackapi/[email protected]
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_E2E_NOTIFICATION_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
with:
payload: |
{
"text": ":fire: EPP GitHub Action e2e test failure",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":fire: EPP e2e test failure",
"emoji": true
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<${{ github.event.pull_request.html_url || github.event.head_commit.url }}|View Pull Request>"
}
}
]
}
approve-images:
runs-on: ubuntu-latest
needs: [test]
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get images from docker-compose
run: |
echo "SERVER_IMAGE_AND_TAG=$(yq '.services.api.image' docker-compose.yaml)" >> $GITHUB_ENV
echo "CLIENT_IMAGE_AND_TAG=$(yq '.services.client.image' docker-compose.yaml)" >> $GITHUB_ENV
echo "IMPORT_IMAGE_AND_TAG=$(yq '.services.worker.image' docker-compose.yaml)" >> $GITHUB_ENV
echo "XSLT_IMAGE_AND_TAG=$(yq '.services.xslt.image' docker-compose.yaml)" >> $GITHUB_ENV
echo "ENCODA_IMAGE_AND_TAG=$(yq '.services.encoda.image' docker-compose.yaml)" >> $GITHUB_ENV
- name: create new manifest for accepted tags
run: |
docker buildx imagetools create -t $CLIENT_IMAGE_AND_TAG-approved $CLIENT_IMAGE_AND_TAG
docker buildx imagetools create -t $SERVER_IMAGE_AND_TAG-approved $SERVER_IMAGE_AND_TAG
docker buildx imagetools create -t $IMPORT_IMAGE_AND_TAG-approved $IMPORT_IMAGE_AND_TAG
docker buildx imagetools create -t $XSLT_IMAGE_AND_TAG-approved $XSLT_IMAGE_AND_TAG
docker buildx imagetools create -t $ENCODA_IMAGE_AND_TAG-approved $ENCODA_IMAGE_AND_TAG
- name: Success Slack Notification
uses: slackapi/[email protected]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_E2E_NOTIFICATION_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
with:
payload: |
{
"text": ":tada: EPP GitHub Action e2e test success and new images approved",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":tada: EPP GitHub Action e2e test success and new images approved",
"emoji": true
}
},
{
"type": "divider"
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Client image:*\n ${{ env.CLIENT_IMAGE_AND_TAG }}"
},
{
"type": "mrkdwn",
"text": "*Server image:*\n ${{ env.SERVER_IMAGE_AND_TAG }}"
},
{
"type": "mrkdwn",
"text": "*import image:*\n ${{ env.IMPORT_IMAGE_AND_TAG }}"
},
{
"type": "mrkdwn",
"text": "*xslt image:*\n ${{ env.XSLT_IMAGE_AND_TAG }}"
},
{
"type": "mrkdwn",
"text": "*encoda image:*\n ${{ env.ENCODA_IMAGE_AND_TAG }}"
}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<${{ github.event.pull_request.html_url || github.event.head_commit.url }}|View Commit>"
}
}
]
}
- name: Failure Slack Notification
uses: slackapi/[email protected]
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_E2E_NOTIFICATION_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
with:
payload: |
{
"text": ":fire: EPP GitHub Action e2e test success, but new images failed to approved",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":fire: EPP GitHub Action e2e test success, but new images failed to approved",
"emoji": true
}
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<${{ github.event.pull_request.html_url || github.event.head_commit.url }}|View Commit>"
}
}
]
}