Skip to content

Commit 2bbc472

Browse files
committed
Run build & test steps on windows & macos if the ci/test label is set
1 parent a5f3d6c commit 2bbc472

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

Diff for: .github/workflows/pr.yml

+23-4
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,31 @@ 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+
os=${{ contains(github.event.pull_request.labels.*.name, 'ci/test') && 'macos-latest windows-latest' || 'ubuntu-latest' }}
25+
echo "matrix={\"os\": $(echo $os | jq -cR 'split(" ")')}" >> $GITHUB_OUTPUT
26+
27+
debug:
28+
runs-on: ubuntu-latest
29+
needs: setup_matrix
30+
steps:
31+
- name: Debug
32+
run: echo "${{ needs.setup_matrix.outputs.matrix }}"
33+
1734
build:
35+
needs: setup_matrix
1836
strategy:
1937
matrix:
38+
os: ${{ fromJson(needs.setup_matrix.outputs.matrix).os }}
2039
dotnet-version: [6.0.x, 8.0.x]
2140

22-
runs-on: ubuntu-latest
41+
runs-on: ${{ matrix.os }}
2342
steps:
2443
- name: Checkout code
2544
uses: actions/checkout@v4
@@ -47,9 +66,9 @@ jobs:
4766
token: ${{ secrets.CODECOV_TOKEN }}
4867
integration-tests:
4968
strategy:
50-
matrix:
51-
os: [ubuntu-latest, windows-latest, macos-11]
52-
dotnet-version: [6.0.x, 8.0.x]
69+
matrix:
70+
os: [ubuntu-latest, windows-latest, macos-11]
71+
dotnet-version: [6.0.x, 8.0.x]
5372
runs-on: ${{ matrix.os }}
5473
steps:
5574
- name: Checkout code

0 commit comments

Comments
 (0)