File tree Expand file tree Collapse file tree 3 files changed +50
-28
lines changed Expand file tree Collapse file tree 3 files changed +50
-28
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,21 @@ concurrency:
3636 group : " ${{ github.workflow }}-${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.sha) || github.ref }}"
3737 cancel-in-progress : true
3838jobs :
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
3950 pr :
4051 name : " PR - ${{ matrix.name }}"
52+ needs :
53+ - calculate_matrix
4154 env :
4255 PR_CI_JOB : 1
4356 CI_JOB_NAME : " ${{ matrix.name }}"
5164 continue-on-error : " ${{ matrix.name == 'mingw-check-tidy' }}"
5265 strategy :
5366 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) }}"
6868 defaults :
6969 run :
7070 shell : " ${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }}"
Original file line number Diff line number Diff line change @@ -340,30 +340,29 @@ concurrency:
340340 cancel-in-progress : true
341341
342342jobs :
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
343354 pr :
344355 << : *base-ci-job
345356 name : PR - ${{ matrix.name }}
357+ needs : [ calculate_matrix ]
346358 env :
347359 << : [*shared-ci-variables, *public-variables]
348360 PR_CI_JOB : 1
349361 if : github.event_name == 'pull_request'
350362 continue-on-error : ${{ matrix.name == 'mingw-check-tidy' }}
351363 strategy :
352364 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) }}
367366
368367 auto :
369368 << : *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