-
Notifications
You must be signed in to change notification settings - Fork 5
341 lines (334 loc) · 11.5 KB
/
main.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
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
name: CI
on:
push:
branches:
- master
pull_request: {}
jobs:
windows:
runs-on: windows-latest
# NB: see https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md for what's available in this image
strategy:
fail-fast: false
matrix:
tsv:
# - target: cpp_stl
# subtarget: _98
# implementation: msvc142
# - target: cpp_stl
# subtarget: _11
# implementation: msvc142
- target: csharp
implementation: net48
env:
TARGET: ${{matrix.tsv.target}}
SUBTARGET: ${{matrix.tsv.subtarget}}
IMPL: ${{matrix.tsv.implementation}}
steps:
- name: Dump matrix context
env:
MATRIX_CONTEXT: ${{ toJson(matrix) }}
run: echo "$MATRIX_CONTEXT"
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: install rsync
run: choco install rsync --no-progress
- name: check rsync version
run: rsync --version
- uses: microsoft/setup-msbuild@v2
- name: prepare
run: |
git clone --depth 1 https://github.com/kaitai-io/kaitai_struct_tests tests
git -C tests rev-parse HEAD
cp -r compiled tests/compiled
./prepare-$TARGET
shell: bash
- name: GitHub Actions job_id parser
uses: Tiryoh/gha-jobid-action@v1
id: job_info
with:
job_name: "${{github.job}} (${{matrix.tsv.target}}${{ format('{0}', matrix.tsv.subtarget) != '' && format(', {0}', matrix.tsv.subtarget) || '' }}, ${{matrix.tsv.implementation}})"
# This is needed if there are more than 30 jobs in the workflow run,
# see https://github.com/Tiryoh/gha-jobid-action/issues/1
per_page: 100
- name: run
env:
GH_JOB_ID: ${{steps.job_info.outputs.job_id}}
GH_HTML_URL: ${{steps.job_info.outputs.html_url}}
working-directory: tests
run: ./ci-$TARGET$SUBTARGET
shell: bash
- name: publish
env:
BOT_SSH_KEY: ${{secrets.BOT_SSH_KEY}}
run: |
./push_artifacts/git_config_kaitai_bot
./push_artifacts/publish \
-o kaitai-io \
-r ci_artifacts \
-m "Build results of ${GITHUB_REF#refs/heads/*} kaitai-io/ci_targets@$GITHUB_SHA" \
-b "${TARGET}${SUBTARGET}"/"$IMPL-windows-x64" \
-- --exclude=.git --exclude=.travis.yml tests/test_out
shell: bash
macos:
runs-on: macos-12
# NB: https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
strategy:
fail-fast: false
matrix:
tsv:
- target: cpp_stl
subtarget: _98
implementation: clang14
- target: cpp_stl
subtarget: _11
implementation: clang14
env:
TARGET: ${{matrix.tsv.target}}
SUBTARGET: ${{matrix.tsv.subtarget}}
IMPL: ${{matrix.tsv.implementation}}
steps:
- name: Dump matrix context
env:
MATRIX_CONTEXT: ${{ toJson(matrix) }}
run: echo "$MATRIX_CONTEXT"
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: prepare
run: |
git clone --depth 1 https://github.com/kaitai-io/kaitai_struct_tests tests
git -C tests rev-parse HEAD
ln -s ../compiled tests/compiled
./prepare-$TARGET
- name: GitHub Actions job_id parser
uses: Tiryoh/gha-jobid-action@v1
id: job_info
with:
job_name: "${{github.job}} (${{matrix.tsv.target}}, ${{matrix.tsv.subtarget}}, ${{matrix.tsv.implementation}})"
# This is needed if there are more than 30 jobs in the workflow run,
# see https://github.com/Tiryoh/gha-jobid-action/issues/1
per_page: 100
- name: run
env:
GH_JOB_ID: ${{steps.job_info.outputs.job_id}}
GH_HTML_URL: ${{steps.job_info.outputs.html_url}}
working-directory: tests
run: ./ci-$TARGET$SUBTARGET
- name: publish
env:
BOT_SSH_KEY: ${{secrets.BOT_SSH_KEY}}
run: |
./push_artifacts/git_config_kaitai_bot
./push_artifacts/publish \
-o kaitai-io \
-r ci_artifacts \
-m "Build results of ${GITHUB_REF#refs/heads/*} kaitai-io/ci_targets@$GITHUB_SHA" \
-b "${TARGET}${SUBTARGET}"/"$IMPL-macos-x86_64" \
-- --exclude=.git --exclude=.travis.yml tests/test_out
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tsv:
- target: csharp
implementation: netcore2.2.103
dotnet: '2.2.103'
- target: csharp
implementation: netcore3.0.100
dotnet: '3.0.100'
env:
TARGET: ${{matrix.tsv.target}}
SUBTARGET: ${{matrix.tsv.subtarget}}
IMPL: ${{matrix.tsv.implementation}}
steps:
- name: Dump matrix context
env:
MATRIX_CONTEXT: ${{ toJson(matrix) }}
run: echo "$MATRIX_CONTEXT"
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{matrix.tsv.dotnet}}
if: matrix.tsv.dotnet
- uses: nuget/setup-nuget@v2
with:
nuget-version: '5.x'
if: matrix.tsv.dotnet
- name: GitHub Actions job_id parser
uses: Tiryoh/gha-jobid-action@v1
id: job_info
with:
job_name: "${{github.job}} (${{matrix.tsv.target}}, ${{matrix.tsv.implementation}}, ${{matrix.tsv.dotnet}})"
# This is needed if there are more than 30 jobs in the workflow run,
# see https://github.com/Tiryoh/gha-jobid-action/issues/1
per_page: 100
- name: prepare
run: |
git clone --depth 1 https://github.com/kaitai-io/kaitai_struct_tests tests
git -C tests rev-parse HEAD
ln -s ../compiled tests/compiled
./prepare-$TARGET
- name: run
env:
GH_JOB_ID: ${{steps.job_info.outputs.job_id}}
GH_HTML_URL: ${{steps.job_info.outputs.html_url}}
working-directory: tests
run: ./ci-$TARGET$SUBTARGET
- name: publish
env:
BOT_SSH_KEY: ${{secrets.BOT_SSH_KEY}}
run: |
./push_artifacts/git_config_kaitai_bot
./push_artifacts/publish \
-o kaitai-io \
-r ci_artifacts \
-m "Build results of ${GITHUB_REF#refs/heads/*} kaitai-io/ci_targets@$GITHUB_SHA" \
-b "${TARGET}${SUBTARGET}"/"$IMPL-linux-x86_64" \
-- --exclude=.git --exclude=.travis.yml tests/test_out
docker:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tsv:
- target: cpp_stl
subtarget: _98
implementation: clang3.4
- target: cpp_stl
subtarget: _11
implementation: clang3.4
- target: cpp_stl
subtarget: _98
implementation: clang11
- target: cpp_stl
subtarget: _11
implementation: clang11
- target: cpp_stl
subtarget: _98
implementation: gcc4.8
- target: cpp_stl
subtarget: _11
implementation: gcc4.8
- target: cpp_stl
subtarget: _98
implementation: gcc11
- target: cpp_stl
subtarget: _11
implementation: gcc11
- target: construct
implementation: python2.7
- target: construct
implementation: python3.4
- target: construct
implementation: python3.12
- target: csharp
implementation: net6.0
- target: graphviz
implementation: '9'
- target: go
implementation: '1.22'
- target: java
implementation: zulu7
- target: java
implementation: temurin8
- target: java
implementation: temurin11
- target: java
implementation: temurin17
- target: java
implementation: temurin21
- target: javascript
implementation: nodejs4
- target: javascript
implementation: nodejs8
- target: javascript
implementation: nodejs10
- target: javascript
implementation: nodejs12
- target: javascript
implementation: nodejs20
- target: lua
implementation: '5.3'
- target: nim
implementation: '1.6.0'
- target: perl
implementation: '5.24'
- target: perl
implementation: '5.40'
- target: php
implementation: '7.1'
- target: php
implementation: '8.3'
- target: python
implementation: '2.7'
- target: python
implementation: '3.4'
- target: python
implementation: '3.12'
- target: ruby
implementation: '1.9'
- target: ruby
implementation: '2.3'
- target: ruby
implementation: '3.3'
env:
TARGET: ${{matrix.tsv.target}}
SUBTARGET: ${{matrix.tsv.subtarget}}
IMPL: ${{matrix.tsv.implementation}}
steps:
- name: Dump matrix context
env:
MATRIX_CONTEXT: ${{ toJson(matrix) }}
run: echo "$MATRIX_CONTEXT"
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: docker pull
run: |
docker pull ghcr.io/kaitai-io/kaitai-"$TARGET"-"$IMPL"-linux-x86_64
- name: download tests
run: |
git clone --depth 1 https://github.com/kaitai-io/kaitai_struct_tests tests
git -C tests rev-parse HEAD
cp -r compiled tests/compiled
- name: download runtime
run: |
mkdir -p runtime
git clone --depth 1 --recurse-submodules https://github.com/kaitai-io/kaitai_struct_${TARGET}_runtime runtime/$TARGET
git -C runtime/$TARGET rev-parse HEAD
if: matrix.tsv.target != 'construct' && matrix.tsv.target != 'graphviz'
- name: GitHub Actions job_id parser
uses: Tiryoh/gha-jobid-action@v1
id: job_info
with:
job_name: "${{github.job}} (${{matrix.tsv.target}}${{ format('{0}', matrix.tsv.subtarget) != '' && format(', {0}', matrix.tsv.subtarget) || '' }}, ${{matrix.tsv.implementation}})"
# This is needed if there are more than 30 jobs in the workflow run,
# see https://github.com/Tiryoh/gha-jobid-action/issues/1
per_page: 100
- name: run
env:
GH_JOB_ID: ${{steps.job_info.outputs.job_id}}
GH_HTML_URL: ${{steps.job_info.outputs.html_url}}
working-directory: tests
run: ./docker-ci -t "$TARGET" -u "$SUBTARGET" -i "$IMPL"
# - name: publish as artifact
# uses: actions/upload-artifact@v3
# with:
# name: test-${{matrix.tsv.target}}${{matrix.tsv.subtarget}}-${{matrix.tsv.implementation}}
# path: tests/test_out
- name: publish
env:
BOT_SSH_KEY: ${{secrets.BOT_SSH_KEY}}
run: |
./push_artifacts/git_config_kaitai_bot
./push_artifacts/publish \
-o kaitai-io \
-r ci_artifacts \
-m "Build results of ${GITHUB_REF#refs/heads/*} kaitai-io/ci_targets@$GITHUB_SHA" \
-b "${TARGET}${SUBTARGET}"/"$IMPL-linux-x86_64" \
-- --exclude=.git --exclude=.travis.yml tests/test_out