Skip to content

Commit

Permalink
Only run setup for the language under test
Browse files Browse the repository at this point in the history
The build_sdk and test jobs both use a matrix to run a similar series of
steps for each language (Java, go, etc.). But it's not necessary for
every step to run for every language; in particular, it's not necessary
to set up any language other than the one under consideration.
  • Loading branch information
squaremo committed Nov 22, 2022
1 parent f69a510 commit 00535d9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ jobs:
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
if: ${{ matrix.language == 'go' }}
uses: actions/setup-go@v2
with:
go-version: ${{matrix.goversion}}
Expand All @@ -181,19 +182,23 @@ jobs:
- name: Install Pulumi CLI
uses: pulumi/action-install-pulumi-cli@v2
- name: Setup Node
if: ${{ matrix.language == 'nodejs' }}
uses: actions/setup-node@v2
with:
node-version: ${{matrix.nodeversion}}
registry-url: https://registry.npmjs.org
- name: Setup DotNet
if: ${{ matrix.language == 'dotnet' }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{matrix.dotnetversion}}
- name: Setup Python
if: ${{ matrix.language == 'python' }}
uses: actions/setup-python@v2
with:
python-version: ${{matrix.pythonversion}}
- name: Setup Java
if: ${{ matrix.language == 'java' }}
uses: actions/setup-java@v3
with:
java-version: ${{matrix.javaversion}}
Expand Down Expand Up @@ -270,6 +275,7 @@ jobs:
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
if: ${{ matrix.language == 'go' }}
uses: actions/setup-go@v2
with:
go-version: ${{matrix.goversion}}
Expand All @@ -280,19 +286,23 @@ jobs:
- name: Install Pulumi CLI
uses: pulumi/action-install-pulumi-cli@v2
- name: Setup Node
if: ${{ matrix.language == 'nodejs' }}
uses: actions/setup-node@v2
with:
node-version: ${{matrix.nodeversion}}
registry-url: https://registry.npmjs.org
- name: Setup DotNet
if: ${{ matrix.language == 'dotnet' }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{matrix.dotnetversion}}
- name: Setup Python
if: ${{ matrix.language == 'python' }}
uses: actions/setup-python@v2
with:
python-version: ${{matrix.pythonversion}}
- name: Setup Java
if: ${{ matrix.language == 'java' }}
uses: actions/setup-java@v3
with:
java-version: ${{matrix.javaversion}}
Expand Down
26 changes: 18 additions & 8 deletions .github/workflows/run-acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,30 +189,35 @@ jobs:
repository: pulumi/scripts
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{matrix.goversion}}
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/action-install-pulumi-cli@v2
- name: Install Go
if: ${{ matrix.language == 'go' }}
uses: actions/setup-go@v2
with:
go-version: ${{matrix.goversion}}
- name: Setup Node
if: ${{ matrix.language == 'nodejs' }}
uses: actions/setup-node@v2
with:
node-version: ${{matrix.nodeversion}}
registry-url: https://registry.npmjs.org
- name: Setup DotNet
if: ${{ matrix.language == 'dotnet' }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{matrix.dotnetversion}}
- name: Setup Python
if: ${{ matrix.language == 'python' }}
uses: actions/setup-python@v2
with:
python-version: ${{matrix.pythonversion}}
- name: Setup Java
if: ${{ matrix.language == 'java' }}
uses: actions/setup-java@v3
with:
java-version: ${{matrix.javaversion}}
Expand Down Expand Up @@ -291,31 +296,36 @@ jobs:
repository: pulumi/scripts
- name: Unshallow clone for tags
run: git fetch --prune --unshallow --tags
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{matrix.goversion}}
- name: Install pulumictl
uses: jaxxstorm/[email protected]
with:
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: pulumi/action-install-pulumi-cli@v2
- name: Install Go
if: ${{ matrix.language == 'go' }}
uses: actions/setup-go@v2
with:
go-version: ${{matrix.goversion}}
- name: Setup Node
if: ${{ matrix.language == 'nodejs' }}
uses: actions/setup-node@v2
with:
node-version: ${{matrix.nodeversion}}
registry-url: https://registry.npmjs.org
- name: Setup DotNet
if: ${{ matrix.language == 'dotnet' }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{matrix.dotnetversion}}
- name: Setup Python
if: ${{ matrix.language == 'python' }}
uses: actions/setup-python@v2
with:
python-version: ${{matrix.pythonversion}}
- name: Setup Java
uses: actions/setup-java@v3
if: ${{ matrix.language == 'java' }}
with:
java-version: ${{matrix.javaversion}}
distribution: temurin
Expand Down

0 comments on commit 00535d9

Please sign in to comment.