-
Notifications
You must be signed in to change notification settings - Fork 35
201 lines (169 loc) · 4.57 KB
/
build_and_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
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
name: 🏗️🧪 Build and Test
on:
push:
branches:
- "main"
- "mw-*"
pull_request:
paths-ignore:
- 'docs/**'
- '**/*.md'
- '**/*.txt'
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Lint
run: ./lint.sh
build:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
component:
[
"wikibase",
"elasticsearch",
"wdqs",
"wdqs-frontend",
"wdqs-proxy",
"quickstatements",
]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build
with:
component: ${{ matrix.component }}
github_token: ${{ secrets.GITHUB_TOKEN }}
test:
strategy:
fail-fast: false
matrix:
suite:
[
repo,
fedprops,
repo_client,
quickstatements,
pingback,
confirm_edit,
elasticsearch,
base__repo,
base__repo_client,
base__pingback,
base__fedprops,
example
]
needs:
- build
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Get built Docker artifacts
uses: actions/download-artifact@v3
with:
name: DockerImages
path: artifacts/
- name: Test ${{ matrix.suite }}
run: ./test.sh ${{ matrix.suite }}
- name: Report Selenium
if: always()
run: |
cd .github/reporter
npm install
node report.js ${{ matrix.suite }}
- name: Show Logs
if: always()
continue-on-error: true
run: |
ls -lahr test/suites/${{ matrix.suite }}/results test/suites/${{ matrix.suite }}/results/*
tail -n +1 test/suites/${{ matrix.suite }}/results/*.log
- name: Archive Docker test artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: TestResults
path: test/suites/**/results
test_upgrade:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
# TODO: can we get this from the environment to not have it hardcoded in the pipeline code?
version: [
# Latest 1.37
'WMDE9',
'WMDE9_BUNDLE',
# Latest 1.38
'WMDE12',
'WMDE12_BUNDLE',
# Latest 1.39
'WMDE13',
'WMDE13_BUNDLE'
]
needs:
- build
steps:
- uses: actions/checkout@v4
- name: Get built Docker artifacts
uses: actions/download-artifact@v3
with:
name: DockerImages
path: artifacts/
- name: Test upgrade from ${{ matrix.version }}
# This step should only take ~5 mins to complete, but sometimes seems to lock up and use the whole job timeout
# Set a specific lower timeout to allow us to retry sooner
timeout-minutes: 10
run: ./test.sh upgrade ${{ matrix.version }}
# TODO: DRY
- name: Archive Docker test artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: TestResults
path: test/suites/**/results
upload_ghcr:
runs-on: ubuntu-latest
timeout-minutes: 20
# we only upload builds to github container registry
# - from main branch builds
# - from release branch builds and
# - builds from PRs going to a release branch
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/mw-') || startsWith(github.base_ref, 'mw-')
needs:
- test
- test_upgrade
strategy:
fail-fast: false
matrix:
docker_image:
[
"wikibase/wikibase",
"wikibase/wikibase-bundle",
"wikibase/elasticsearch",
"wikibase/wdqs",
"wikibase/wdqs-frontend",
"wikibase/wdqs-proxy",
"wikibase/quickstatements",
]
steps:
- uses: actions/checkout@v4
- name: Get built Docker images
uses: actions/download-artifact@v3
with:
name: DockerImages
path: artifacts/
- name: Load docker images
shell: bash
run: |
for file in artifacts/*.docker.tar.gz; do
docker load -i "$file"
done
- uses: ./.github/actions/push-ghcr
with:
component: ${{ matrix.component }}