Skip to content

Commit 9301293

Browse files
authored
Add prepare job to set OS list for CI workflow
1 parent 33d401d commit 9301293

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,21 @@ on:
2121

2222

2323
jobs:
24+
prepare:
25+
runs-on: ubuntu-latest
26+
outputs:
27+
os_list: ${{ steps.set.outputs.os_list }}
28+
steps:
29+
- id: set
30+
run: |
31+
if [[ "${{ github.event_name }}" == "pull_request" ]] ||
32+
[[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" != refs/tags/v* ]] ||
33+
[[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ inputs.full_build }}" != "true" ]]; then
34+
echo 'os_list=["ubuntu-22.04","windows-2022"]' >> $GITHUB_OUTPUT
35+
else
36+
echo 'os_list=["ubuntu-22.04","windows-2022","macos-14"]' >> $GITHUB_OUTPUT
37+
fi
38+
2439
build-and-test:
2540
name: Run on ${{ matrix.os }} with SOFA ${{ matrix.sofa_branch }} / MeshRefinement=${{ matrix.with_mesh_refinement }}
2641

@@ -43,13 +58,7 @@ jobs:
4358
fail-fast: false
4459

4560
matrix:
46-
os: ${{ fromJSON(
47-
(github.event_name == 'pull_request' ||
48-
(github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v')) ||
49-
(github.event_name == 'workflow_dispatch' && inputs.full_build != 'true'))
50-
&& '["ubuntu-22.04","windows-2022"]'
51-
|| '["ubuntu-22.04","windows-2022","macos-14"]'
52-
) }}
61+
os: ${{ fromJSON(needs.prepare.outputs.os_list) }}
5362

5463
sofa_branch: [master]
5564
with_mesh_refinement: [ON, OFF]

0 commit comments

Comments
 (0)