Skip to content

Commit c4adea2

Browse files
committed
m
1 parent a4c0dde commit c4adea2

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

.github/workflows/pr.yml

+23-7
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,34 @@ env:
1414
PULUMI_TEST_OWNER: "moolumi"
1515

1616
jobs:
17+
setup_matrix:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
matrix: ${{ steps.set-matrix.outputs.matrix }}
21+
steps:
22+
- id: set-matrix
23+
run: |
24+
platforms=${{ contains(github.event.pull_request.labels.*.name, 'ci/test') && 'macos-latest windows-latest' || 'ubuntu-latest' }}
25+
echo "matrix={\"platforms\": $(echo $platforms | jq -cR 'split(" ")')}"
26+
echo "matrix={\"platforms\": $(echo $platforms | jq -cR 'split(" ")')}" >> $GITHUB_OUTPUT
27+
28+
debug:
29+
runs-on: ubuntu-latest
30+
needs: setup_matrix
31+
steps:
32+
- name: Debug
33+
run: echo XX"${{ needs.setup_matrix.outputs.matrix }}"XX
34+
- name: Debug2
35+
run: echo XX"${{ fromJson(needs.setup_matrix.outputs.matrix).platforms }}"XX
36+
1737
build:
38+
needs: setup_matrix
1839
strategy:
1940
matrix:
20-
os: >- # No newlines or trailing newline.
21-
${{
22-
contains(github.event.pull_request.labels.*.name, 'ci/test')
23-
&& 'macos-latest windows-latest'
24-
|| 'ubuntu-latest'
25-
}}
41+
os: ${{ fromJson(needs.setup_matrix.outputs.matrix).platforms }}
2642
dotnet-version: [6.0.x, 8.0.x]
2743

28-
runs-on: ubuntu-latest
44+
runs-on: ${{ matrix.os }}
2945
steps:
3046
- name: Checkout code
3147
uses: actions/checkout@v4

0 commit comments

Comments
 (0)