From 00535d965d97428be5448326edb204b8ff28ff88 Mon Sep 17 00:00:00 2001 From: Michael Bridgen Date: Tue, 22 Nov 2022 14:02:29 +0000 Subject: [PATCH] Only run setup for the language under test 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. --- .github/workflows/build.yml | 10 +++++++++ .github/workflows/run-acceptance-tests.yml | 26 +++++++++++++++------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ef0f6d908..7fa16da7ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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}} @@ -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}} @@ -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}} @@ -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}} diff --git a/.github/workflows/run-acceptance-tests.yml b/.github/workflows/run-acceptance-tests.yml index 165e788029..1e1a31e3e1 100644 --- a/.github/workflows/run-acceptance-tests.yml +++ b/.github/workflows/run-acceptance-tests.yml @@ -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/action-install-gh-release@v1.5.0 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}} @@ -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/action-install-gh-release@v1.5.0 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