Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run build & test steps on windows & macos if the ci/test label is set #227

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 27 additions & 7 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,34 @@ env:
PULUMI_TEST_OWNER: "moolumi"

jobs:
setup_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
os="${{ contains(github.event.pull_request.labels.*.name, 'ci/test') && 'ubuntu-latest macos-latest windows-latest' || 'ubuntu-latest' }}"
echo "matrix={\"os\": $(echo $os | jq -cR 'split(" ")')}" >> $GITHUB_OUTPUT

format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup dotnet SDK v6.0
uses: actions/setup-dotnet@v4
- name: Format Pulumi SDK
run: dotnet run format-sdk verify

build:
needs: setup_matrix
strategy:
matrix:
os: ${{ fromJson(needs.setup_matrix.outputs.matrix).os }}
dotnet-version: [6.0.x, 8.0.x]

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -29,8 +51,6 @@ jobs:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Install Pulumi CLI
uses: pulumi/actions@v5
- name: Format Pulumi SDK
run: dotnet run format-sdk verify
- name: Build Pulumi SDK
run: dotnet run build-sdk
- name: Test Pulumi SDK
Expand All @@ -47,9 +67,9 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
integration-tests:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-11]
dotnet-version: [6.0.x, 8.0.x]
matrix:
os: [ubuntu-latest, windows-latest, macos-11]
dotnet-version: [6.0.x, 8.0.x]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
Expand Down Expand Up @@ -123,7 +143,7 @@ jobs:
- name: TestDeletedWith
run: dotnet run integration test TestDeletedWith
check-pr:
needs: ["build", "integration-tests"]
needs: ["build", "integration-tests", "format"]
runs-on: ubuntu-latest
steps:
- name: OK
Expand Down