-
Notifications
You must be signed in to change notification settings - Fork 11
311 lines (311 loc) · 8.22 KB
/
test.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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
name: Test
on:
push:
branches:
- main
- 3.15.x
- 3.16.x
- bump-rbe
pull_request:
jobs:
unit-test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
otp:
- "25.3"
- "26.2"
steps:
- name: CHECKOUT
uses: actions/checkout@v4
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- name: UNIT TEST
run: |
ERLANG_HOME="$(dirname $(dirname $(which erl)))"
bazelisk test //... \
--noenable_bzlmod \
--color=yes
unit-test-bzlmod:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
otp:
- "25.3"
- "26.2"
steps:
- name: CHECKOUT
uses: actions/checkout@v4
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- name: UNIT TEST
run: |
ERLANG_HOME="$(dirname $(dirname $(which erl)))"
bazelisk test //... \
--color=yes
test:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
otp:
- "25.3"
- "26.2"
steps:
- name: CHECKOUT
uses: actions/checkout@v4
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- name: TEST
working-directory: test
run: |
ERLANG_HOME="$(dirname $(dirname $(which erl)))"
bazelisk test //... \
--noenable_bzlmod \
--color=yes
- name: RESOVLE TEST LOGS PATH
if: always()
working-directory: test
run: |
echo "LOGS_PATH=$(readlink -f bazel-testlogs)" >> $GITHUB_OUTPUT
id: resolve-test-logs-path
- name: CAPTURE TEST LOGS
if: always()
uses: actions/upload-artifact@v4
with:
name: bazel-testlogs-${{matrix.otp}}
path: ${{ steps.resolve-test-logs-path.outputs.LOGS_PATH }}/*
test-bzlmod:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
otp:
- "25.3"
- "26.2"
steps:
- name: CHECKOUT
uses: actions/checkout@v4
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- name: TEST
working-directory: test
run: |
bazelisk test //... \
--color=yes
- name: RESOVLE TEST LOGS PATH
if: always()
working-directory: test
run: |
echo "LOGS_PATH=$(readlink -f bazel-testlogs)" >> $GITHUB_OUTPUT
id: resolve-test-logs-path
- name: CAPTURE TEST LOGS
if: always()
uses: actions/upload-artifact@v4
with:
name: bazel-testlogs-bzlmod-${{matrix.otp}}
path: ${{ steps.resolve-test-logs-path.outputs.LOGS_PATH }}/*
test-bzlmod-macos:
runs-on: macos-latest
steps:
- name: CHECKOUT
uses: actions/checkout@v4
- name: CONFIGURE ERLANG
run: |
brew install erlang
- name: TEST
working-directory: test
run: |
ERLANG_HOME="$(dirname $(dirname $(which erl)))"
bazelisk test //... \
--color=yes
- name: RESOVLE TEST LOGS PATH
if: always()
working-directory: test
run: |
echo "LOGS_PATH=$(readlink -f bazel-testlogs)" >> $GITHUB_OUTPUT
id: resolve-test-logs-path
- name: CAPTURE TEST LOGS
if: always()
uses: actions/upload-artifact@v4
with:
name: bazel-testlogs-bzlmod-macos
path: ${{ steps.resolve-test-logs-path.outputs.LOGS_PATH }}/*
test-bzlmod-windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
otp:
- "25.3"
steps:
- name: CHECKOUT
uses: actions/checkout@v4
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- name: CONFIGURE BAZEL
working-directory: test
shell: bash
run: |
cat << EOF >> user.bazelrc
startup --output_user_root=C:/tmp
startup --windows_enable_symlinks
build --enable_runfiles
build --color=yes
build --@rules_erlang//:ct_test_windows_logdir_drive_letter=z
build --jobs=1
EOF
- name: TEST
working-directory: test
shell: cmd
run: |
bazelisk test //...
- name: RESOVLE TEST LOGS PATH
if: always()
working-directory: test
shell: bash
run: |
LOGS_TAR=$PWD/logs.tar
cd bazel-testlogs
tar -cf $LOGS_TAR *
- name: CAPTURE TEST LOGS
if: always()
uses: actions/upload-artifact@v4
with:
name: bazel-testlogs-bzlmod-windows-${{matrix.otp}}
path: test/logs.tar
test-bzlmod-internal-erlang:
runs-on: ubuntu-20.04
steps:
- name: CHECKOUT
uses: actions/checkout@v4
- name: CONFIGURE BAZEL
working-directory: test
run: |
cat << EOF >> user.bazelrc
build:buildbuddy --remote_download_minimal
build:buildbuddy --color=yes
EOF
- name: BUILD
working-directory: test
run: |
bazelisk build @rules_erlang//tools:erlang_headers \
--config=rbe \
--toolchain_resolution_debug="@rules_erlang.*" \
--verbose_failures
- name: TEST
working-directory: test
run: |
bazelisk test //... \
--config=rbe \
--toolchain_resolution_debug="@rules_erlang.*" \
--verbose_failures \
--build_tests_only
- name: RESOVLE TEST LOGS PATH
if: always()
working-directory: test
run: |
echo "LOGS_PATH=$(readlink -f bazel-testlogs)" >> $GITHUB_OUTPUT
id: resolve-test-logs-path
- name: CAPTURE TEST LOGS
if: always()
uses: actions/upload-artifact@v4
with:
name: bazel-testlogs-bzlmod-internal-erlang
path: ${{ steps.resolve-test-logs-path.outputs.LOGS_PATH }}/*
test-bzlmod-coverage:
runs-on: ubuntu-20.04
steps:
- name: CHECKOUT
uses: actions/checkout@v4
# - name: INSTALL LCOV
# run: |
# sudo apt-get install -y lcov
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1
with:
otp-version: 26
- name: COVERAGE
working-directory: test
run: |
bazelisk coverage --combined_report=lcov //...
# - name: GENHTML
# working-directory: test
# run: |
# head "$(bazel info output_path)/_coverage/_coverage_report.dat"
# genhtml --output genhtml "$(bazel info output_path)/_coverage/_coverage_report.dat"
- name: RESOVLE TEST LOGS PATH
if: always()
working-directory: test
run: |
echo "LOGS_PATH=$(readlink -f bazel-testlogs)" >> $GITHUB_OUTPUT
id: resolve-test-logs-path
- name: CAPTURE TEST LOGS
if: always()
uses: actions/upload-artifact@v4
with:
name: bazel-testlogs-bzlmod-coverage
path: ${{ steps.resolve-test-logs-path.outputs.LOGS_PATH }}/*
test-host-erlang-change-detected:
runs-on: ubuntu-20.04
steps:
- name: CHECKOUT
uses: actions/checkout@v4
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1
with:
otp-version: "25.0"
- name: BUILD
working-directory: test
id: before
run: |
bazelisk build :otp_version \
--color=yes
echo "otp=$(cat bazel-bin/otp_version.txt)" >> $GITHUB_OUTPUT
- name: CONFIGURE ERLANG
uses: erlef/setup-beam@v1
with:
otp-version: "24.3"
- name: BUILD
working-directory: test
id: after
run: |
bazelisk build :otp_version \
--color=yes
echo "otp=$(cat bazel-bin/otp_version.txt)" >> $GITHUB_OUTPUT
- name: CHECK
run: |
set -x
if [[ "${{ steps.before.outputs.otp }}" == "${{ steps.after.outputs.otp }}" ]]; then
echo "Fail"
fi
summary:
needs:
- unit-test
- unit-test-bzlmod
- test
- test-bzlmod
- test-bzlmod-macos
- test-bzlmod-windows
- test-bzlmod-internal-erlang
- test-bzlmod-coverage
- test-host-erlang-change-detected
runs-on: ubuntu-latest
steps:
- name: SUMMARY
run: |
cat << 'EOF' | jq -e 'map(.result == "success") | all(.)'
${{ toJson(needs) }}
EOF