File tree 3 files changed +50
-28
lines changed
3 files changed +50
-28
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,21 @@ concurrency:
36
36
group : " ${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.sha) || github.ref }}"
37
37
cancel-in-progress : true
38
38
jobs :
39
+ calculate_matrix :
40
+ name : Calculate job matrix
41
+ runs-on : ubuntu-latest
42
+ outputs :
43
+ jobs : " ${{ steps.jobs.outputs.jobs }}"
44
+ steps :
45
+ - name : Checkout the source code
46
+ uses : actions/checkout@v4
47
+ - name : Calculate the CI job matrix
48
+ run : python3 src/ci/scripts/calculate-job-matrix.py >> $GITHUB_OUTPUT
49
+ id : jobs
39
50
pr :
40
51
name : " PR - ${{ matrix.name }}"
52
+ needs :
53
+ - calculate_matrix
41
54
env :
42
55
PR_CI_JOB : 1
43
56
CI_JOB_NAME : " ${{ matrix.name }}"
51
64
continue-on-error : " ${{ matrix.name == 'mingw-check-tidy' }}"
52
65
strategy :
53
66
matrix :
54
- include :
55
- - name : mingw-check
56
- os : ubuntu-20.04-4core-16gb
57
- env : {}
58
- - name : mingw-check-tidy
59
- os : ubuntu-20.04-4core-16gb
60
- env : {}
61
- - name : x86_64-gnu-llvm-17
62
- env :
63
- ENABLE_GCC_CODEGEN : " 1"
64
- os : ubuntu-20.04-16core-64gb
65
- - name : x86_64-gnu-tools
66
- os : ubuntu-20.04-16core-64gb
67
- env : {}
67
+ include : " ${{ fromJSON(needs.calculate_matrix.outputs.jobs) }}"
68
68
defaults :
69
69
run :
70
70
shell : " ${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }}"
Original file line number Diff line number Diff line change @@ -340,30 +340,29 @@ concurrency:
340
340
cancel-in-progress : true
341
341
342
342
jobs :
343
+ calculate_matrix :
344
+ name : Calculate job matrix
345
+ runs-on : ubuntu-latest
346
+ outputs :
347
+ jobs : ${{ steps.jobs.outputs.jobs }}
348
+ steps :
349
+ - name : Checkout the source code
350
+ uses : actions/checkout@v4
351
+ - name : Calculate the CI job matrix
352
+ run : python3 src/ci/scripts/calculate-job-matrix.py >> $GITHUB_OUTPUT
353
+ id : jobs
343
354
pr :
344
355
<< : *base-ci-job
345
356
name : PR - ${{ matrix.name }}
357
+ needs : [ calculate_matrix ]
346
358
env :
347
359
<< : [*shared-ci-variables, *public-variables]
348
360
PR_CI_JOB : 1
349
361
if : github.event_name == 'pull_request'
350
362
continue-on-error : ${{ matrix.name == 'mingw-check-tidy' }}
351
363
strategy :
352
364
matrix :
353
- include :
354
- - name : mingw-check
355
- << : *job-linux-4c
356
-
357
- - name : mingw-check-tidy
358
- << : *job-linux-4c
359
-
360
- - name : x86_64-gnu-llvm-17
361
- env :
362
- ENABLE_GCC_CODEGEN : " 1"
363
- << : *job-linux-16c
364
-
365
- - name : x86_64-gnu-tools
366
- << : *job-linux-16c
365
+ include : ${{ fromJSON(needs.calculate_matrix.outputs.jobs) }}
367
366
368
367
auto :
369
368
<< : *base-ci-job
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+
3
+ import json
4
+
5
+ if __name__ == "__main__" :
6
+ data = [dict (
7
+ name = "mingw-check" ,
8
+ os = "ubuntu-20.04-4core-16gb" ,
9
+ env = {}
10
+ ), dict (
11
+ name = "mingw-check-tidy" ,
12
+ os = "ubuntu-20.04-4core-16gb" ,
13
+ env = {}
14
+ ), dict (
15
+ name = "x86_64-gnu-llvm-17" ,
16
+ os = "ubuntu-20.04-16core-64gb" ,
17
+ env = dict (ENABLE_GCC_CODEGEN = "1" )
18
+ ), dict (
19
+ name = "x86_64-gnu-tools" ,
20
+ os = "ubuntu-20.04-16core-64gb" ,
21
+ env = {}
22
+ )]
23
+ print (json .dumps (data , indent = 4 ))
You can’t perform that action at this time.
0 commit comments