Skip to content

Commit e920eba

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

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.github/workflows/pr.yml

+16-4
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,24 @@ 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') && 'ubuntu-latest macos-latest windows-latest' || 'ubuntu-latest' }}"
25+
echo "matrix={\"os\": $(echo $os | jq -cR 'split(" ")')}" >> $GITHUB_OUTPUT
26+
1727
build:
28+
needs: setup_matrix
1829
strategy:
1930
matrix:
31+
os: ${{ fromJson(needs.setup_matrix.outputs.matrix).os }}
2032
dotnet-version: [6.0.x, 8.0.x]
2133

22-
runs-on: ubuntu-latest
34+
runs-on: ${{ matrix.os }}
2335
steps:
2436
- name: Checkout code
2537
uses: actions/checkout@v4
@@ -47,9 +59,9 @@ jobs:
4759
token: ${{ secrets.CODECOV_TOKEN }}
4860
integration-tests:
4961
strategy:
50-
matrix:
51-
os: [ubuntu-latest, windows-latest, macos-11]
52-
dotnet-version: [6.0.x, 8.0.x]
62+
matrix:
63+
os: [ubuntu-latest, windows-latest, macos-11]
64+
dotnet-version: [6.0.x, 8.0.x]
5365
runs-on: ${{ matrix.os }}
5466
steps:
5567
- name: Checkout code

0 commit comments

Comments
 (0)