forked from thesaurus-linguae-aegyptiae/tla-web
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (113 loc) · 3.58 KB
/
e2e.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
---
name: deploy
on:
push:
branches:
- main
pull_request:
paths:
- 'src/test/e2e/**'
- 'src/main/**'
- 'Dockerfile'
- 'docker-compose.yml'
- '.dockerignore'
- '.github/workflows/e2e.yml'
schedule:
- cron: '0 0 1,15 * *'
env:
DATA_URL: >-
http://aaew64.bbaw.de/resources/tla-data/tla-sample-20210115-1000t.tar.gz
jobs:
check_url:
runs-on: ubuntu-latest
outputs:
url_response: ${{ steps.check.outputs.response_code }}
steps:
- id: check
run: |
rc=$(curl -sIo /dev/null "${{ env.DATA_URL }}" \
-w "%{http_code}" || true)
echo "response_code=${rc}" >> "${GITHUB_OUTPUT}"
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.0
- name: start backend containers
run: docker compose up -d backend
- name: lint cypress test specs
run: npm ci && npm run lint
working-directory: ./src/test/e2e/
- name: start frontend container
run: docker compose up -d frontend
- name: install cypress dependencies
run: >-
sudo apt-get install -y --no-install-recommends xvfb libglib2.0-0
libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgtk-3-0 libgbm1
libasound2t64
- name: query backend endpoint URL paths list
run: curl -s localhost:8090/
- name: run cypress smoke test
run: >-
npx cypress run -s cypress/tests/language_switcher.spec.js
working-directory: ./src/test/e2e/
e2e:
needs: check_url
if: needs.check_url.outputs.url_response != '404'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.0
- name: start && populate backend containers
run: docker compose up -d backend populate
env:
SAMPLE_URL: ${{ env.DATA_URL }}
ES_PORT: 9201
- name: start frontend container
run: docker compose up -d frontend
env:
LISTEN_PORT: 8080
- name: show tla-backend container logs
run: docker compose logs backend
- name: wait for backend to be populated with lemma data
run: bash .github/scripts/wait_for_response.sh
env:
url: http://localhost:8090/lemma/get/100690
interval: 5
timeout: 120
continue-on-error: true
- name: wait for backend to be populated with meta data
run: bash .github/scripts/wait_for_response.sh
env:
url: http://localhost:8090/version
interval: 3
timeout: 60
continue-on-error: true
- name: wait for backend to be populated with thesaurus data
run: bash .github/scripts/wait_for_response.sh
env:
url: http://localhost:8090/ths/get/7pupjz
interval: 5
timeout: 120
- name: show tla-ingest container logs
run: docker compose logs populate
if: always()
- name: query backend version info
run: curl -s localhost:8090/version
- name: wait for frontend to respond
run: bash .github/scripts/wait_for_response.sh
env:
url: http://localhost:8080
interval: 2
timeout: 120
- name: run cypress e2e tests
run: docker compose run e2e
env:
CYPRESS_BASE_URL: http://localhost:8080
CYPRESS_VIDEO: false
CYPRESS_BROWSER: firefox
- name: upload cypress screenshots
if: failure()
uses: actions/upload-artifact@v4.4.3
with:
path: src/test/e2e/cypress/screenshots
name: cypress-screenshots
...