diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/build_sdk.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/build_sdk.yml index fa76797a41..79b2713685 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/build_sdk.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/build_sdk.yml @@ -15,15 +15,6 @@ jobs: build_sdk: name: build_sdk runs-on: #{{ if .Config.runner.buildSdk }}##{{- .Config.runner.buildSdk }}##{{ else }}##{{- .Config.runner.default }}##{{ end }}# - strategy: - fail-fast: true - matrix: - language: - - nodejs - - python - - dotnet - - go - - java steps: - name: Checkout Repo uses: #{{ .Config.actionVersions.checkout }}# @@ -47,8 +38,8 @@ jobs: run: make install_plugins - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Build SDK - run: make build_${{ matrix.language }} + - name: Build SDKs + run: make -j4 build_sdks - name: Check worktree clean uses: pulumi/git-status-check-action@v1 with: @@ -58,7 +49,11 @@ jobs: sdk/go/**/pulumiUtilities.go sdk/nodejs/package.json sdk/python/pyproject.toml + - name: Tar SDK folder + run: tar -zcf sdk.tar.gz -C sdk . - name: Upload SDK - uses: ./.github/actions/upload-sdk + uses: actions/upload-artifact@v4 with: - language: ${{ matrix.language }} + name: sdk.tar.gz + path: ${{ github.workspace}}/sdk.tar.gz + retention-days: 30 diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml index 664501abd7..28cbc3a31a 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml @@ -41,16 +41,16 @@ jobs: name: comment-notification runs-on: #{{ .Config.runner.default }}# steps: - - id: run-url - name: Create URL to the run output - run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> "$GITHUB_OUTPUT" - - name: Update with Result - uses: peter-evans/create-or-update-comment@v1 - with: - body: "Please view the PR build: ${{ steps.run-url.outputs.run-url }}" - issue-number: ${{ github.event.client_payload.github.payload.issue.number }} - repository: ${{ github.event.client_payload.github.payload.repository.full_name }} - token: ${{ secrets.PULUMI_BOT_TOKEN }} + - id: run-url + name: Create URL to the run output + run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> "$GITHUB_OUTPUT" + - name: Update with Result + uses: peter-evans/create-or-update-comment@v1 + with: + body: "Please view the PR build: ${{ steps.run-url.outputs.run-url }}" + issue-number: ${{ github.event.client_payload.github.payload.issue.number }} + repository: ${{ github.event.client_payload.github.payload.repository.full_name }} + token: ${{ secrets.PULUMI_BOT_TOKEN }} #{{ if .Config.lint -}}# lint: if: github.event_name == 'repository_dispatch' || @@ -65,28 +65,28 @@ jobs: if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository needs: - - test - - build_provider - - license_check - #{{- if .Config.lint }}# - - lint - #{{- end }}# - #{{- range $action, $_ := .Config.extraTests }}# - - #{{ $action }}# + - test + - build_provider + - license_check + #{{- if .Config.lint }}# + - lint + #{{- end }}# + #{{- range $action, $_ := .Config.extraTests }}# + - #{{ $action }}# #{{- end }}# runs-on: #{{ .Config.runner.default }}# steps: - - uses: guibranco/github-status-action-v2@0849440ec82c5fa69b2377725b9b7852a3977e76 - with: - authToken: ${{secrets.GITHUB_TOKEN}} - # Write an explicit status check called "Sentinel" which will only pass if this code really runs. - # This should always be a required check for PRs. - context: 'Sentinel' - description: 'All required checks passed' - state: 'success' - # Write to the PR commit SHA if it's available as we don't want the merge commit sha, - # otherwise use the current SHA for any other type of build. - sha: ${{ github.event.pull_request.head.sha || github.sha }} + - uses: guibranco/github-status-action-v2@0849440ec82c5fa69b2377725b9b7852a3977e76 + with: + authToken: ${{secrets.GITHUB_TOKEN}} + # Write an explicit status check called "Sentinel" which will only pass if this code really runs. + # This should always be a required check for PRs. + context: "Sentinel" + description: "All required checks passed" + state: "success" + # Write to the PR commit SHA if it's available as we don't want the merge commit sha, + # otherwise use the current SHA for any other type of build. + sha: ${{ github.event.pull_request.head.sha || github.sha }} test: if: github.event_name == 'repository_dispatch' || @@ -102,128 +102,123 @@ jobs: env: PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} steps: -#{{- if .Config.freeDiskSpaceBeforeTest }}# - # Run as first step so we don't delete things that have just been installed - - name: Free Disk Space (Ubuntu) - uses: #{{ .Config.actionVersions.freeDiskSpace }}# - with: - tool-cache: false - swap-storage: false -#{{- end }}# - - name: Checkout Repo - uses: #{{ .Config.actionVersions.checkout }}# - with: - ref: ${{ env.PR_COMMIT_SHA }} - #{{- if .Config.checkoutSubmodules }}# - submodules: #{{ .Config.checkoutSubmodules }}# - #{{- end }}# - - name: Checkout p/examples - if: matrix.testTarget == 'pulumiExamples' - uses: #{{ .Config.actionVersions.checkout }}# - with: - repository: pulumi/examples - path: p-examples - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - run: |- - pip3 install virtualenv==20.0.23 - pip3 install pipenv - #{{- if .Config.docker }}# - - name: Run docker compose - run: docker compose -f testing/docker-compose.yml up --build -d - #{{- end }}# - #{{- if .Config.aws }}# - - name: Configure AWS Credentials - uses: #{{ .Config.actionVersions.configureAwsCredentials }}# - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 7200 - role-session-name: #{{ .Config.provider }}#@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - #{{- end }}# - #{{- if .Config.gcp }}# - - name: Authenticate to Google Cloud - uses: #{{ .Config.actionVersions.googleAuth }}# - with: - service_account: ${{ env.GOOGLE_CI_SERVICE_ACCOUNT_EMAIL }} - workload_identity_provider: projects/${{ env.GOOGLE_PROJECT_NUMBER - }}/locations/global/workloadIdentityPools/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_POOL }}/providers/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER }} - - name: Setup gcloud auth - uses: #{{ .Config.actionVersions.setupGcloud }}# - with: - install_components: gke-gcloud-auth-plugin - #{{- end }}# - #{{- if .Config.gcpRegistry }}# - - name: Login to Google Cloud Registry - run: gcloud --quiet auth configure-docker - #{{- end }}# - #{{- if .Config.sshPrivateKey }}# - - name: Setup SSH key - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: #{{ .Config.sshPrivateKey }}# - #{{- end }}# - #{{- if .Config.integrationTestProvider }}# - - name: Prepare upstream code - run: make upstream - #{{- end }}# - #{{- if index .Config "setup-script" }}# - - name: Run setup script - run: #{{ index .Config "setup-script" }}# - #{{- end }}# - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.5.0 -#{{- if .Config.actions.preTest }}# -#{{ .Config.actions.preTest | toYaml | indent 4 }}# -#{{- end }}# - #{{- if .Config.integrationTestProvider }}# - - name: Run provider tests - if: matrix.testTarget == 'local' - working-directory: provider - run: go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - #{{- end }}# - - name: Run tests - if: matrix.testTarget == 'local' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - name: Run pulumi/examples tests - if: matrix.testTarget == 'pulumiExamples' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -run TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + #{{- if .Config.freeDiskSpaceBeforeTest }}# + # Run as first step so we don't delete things that have just been installed + - name: Free Disk Space (Ubuntu) + uses: #{{ .Config.actionVersions.freeDiskSpace }}# + with: + tool-cache: false + swap-storage: false + #{{- end }}# + - name: Checkout Repo + uses: #{{ .Config.actionVersions.checkout }}# + with: + ref: ${{ env.PR_COMMIT_SHA }} + #{{- if .Config.checkoutSubmodules }}# + submodules: #{{ .Config.checkoutSubmodules }}# + #{{- end }}# + #{{- if .Config.testPulumiExamples }}# + - name: Checkout p/examples + uses: #{{ .Config.actionVersions.checkout }}# + with: + repository: pulumi/examples + path: p-examples + #{{- end }}# + - name: Setup tools + uses: ./.github/actions/setup-tools + with: + tools: pulumictl, pulumicli, go, node, dotnet, python, java + - name: Download bin + uses: ./.github/actions/download-bin + - run: dotnet nuget add source ${{ github.workspace }}/nuget + - name: Download SDK + uses: actions/download-artifact@v4 + with: + name: sdk.tar.gz + path: ${{ github.workspace}} + - name: UnTar SDK folder + run: tar -zxf ${{ github.workspace}}/sdk.tar.gz -C ${{github.workspace}}/sdk + - name: Update path + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + - name: Install Python deps + run: |- + pip3 install virtualenv==20.0.23 + pip3 install pipenv + #{{- if .Config.docker }}# + - name: Run docker compose + run: docker compose -f testing/docker-compose.yml up --build -d + #{{- end }}# + #{{- if .Config.aws }}# + - name: Configure AWS Credentials + uses: #{{ .Config.actionVersions.configureAwsCredentials }}# + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-region: ${{ env.AWS_REGION }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + role-duration-seconds: 7200 + role-session-name: #{{ .Config.provider }}#@githubActions + role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} + #{{- end }}# + #{{- if .Config.gcp }}# + - name: Authenticate to Google Cloud + uses: #{{ .Config.actionVersions.googleAuth }}# + with: + service_account: ${{ env.GOOGLE_CI_SERVICE_ACCOUNT_EMAIL }} + workload_identity_provider: projects/${{ env.GOOGLE_PROJECT_NUMBER + }}/locations/global/workloadIdentityPools/${{ + env.GOOGLE_CI_WORKLOAD_IDENTITY_POOL }}/providers/${{ + env.GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER }} + - name: Setup gcloud auth + uses: #{{ .Config.actionVersions.setupGcloud }}# + with: + install_components: gke-gcloud-auth-plugin + #{{- end }}# + #{{- if .Config.gcpRegistry }}# + - name: Login to Google Cloud Registry + run: gcloud --quiet auth configure-docker + #{{- end }}# + #{{- if .Config.sshPrivateKey }}# + - name: Setup SSH key + uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: #{{ .Config.sshPrivateKey }}# + #{{- end }}# + #{{- if .Config.integrationTestProvider }}# + - name: Prepare upstream code + run: make upstream + #{{- end }}# + #{{- if index .Config "setup-script" }}# + - name: Run setup script + run: #{{ index .Config "setup-script" }}# + #{{- end }}# + - name: Install dependencies + run: make install_sdks + - name: Install gotestfmt + uses: GoTestTools/gotestfmt-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: v2.5.0 + #{{- if .Config.actions.preTest }}# + #{{ .Config.actions.preTest | toYaml | indent 4 }}# + #{{- end }}# + #{{- if .Config.integrationTestProvider }}# + - name: Shard provider tests + working-directory: provider + run: go run github.com/blampe/shard --total ${{ strategy.job-total }} --index ${{ strategy.job-index }} > tests + - name: Run provider tests + working-directory: provider + run: xargs go test -v -json -count=1 -cover -timeout 2h -tags=all -parallel 4 {} < tests 2>&1 | tee /tmp/gotest.log | gotestfmt + #{{- end }}# + - name: Shard tests + working-directory: examples + run: go run github.com/blampe/shard --total ${{ strategy.job-total }} --index ${{ strategy.job-index }} > tests + - name: Run tests + working-directory: examples + run: xargs go test -v -json -count=1 -cover -timeout 2h -tags=all -parallel 4 {} < tests 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: fail-fast: false matrix: - language: - - nodejs - - python - - dotnet - - go - - java - #{{- if .Config.testPulumiExamples }}# - testTarget: [local, pulumiExamples] - #{{- else }}# - testTarget: [local] - #{{- end }}# + shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] license_check: name: License Check uses: ./.github/workflows/license.yml @@ -235,7 +230,7 @@ name: run-acceptance-tests on: pull_request: paths-ignore: - - CHANGELOG.md + - CHANGELOG.md repository_dispatch: types: - - run-acceptance-tests-command + - run-acceptance-tests-command diff --git a/provider-ci/test-providers/aws/.ci-mgmt.yaml b/provider-ci/test-providers/aws/.ci-mgmt.yaml index 27110db0fd..31f606318c 100644 --- a/provider-ci/test-providers/aws/.ci-mgmt.yaml +++ b/provider-ci/test-providers/aws/.ci-mgmt.yaml @@ -126,7 +126,7 @@ extraTests: with: tool-cache: false swap-storage: false - dotnet: ${{ matrix.language != 'dotnet' }} + dotnet: false - name: Checkout Repo uses: actions/checkout@v4 with: @@ -153,15 +153,14 @@ extraTests: - name: Download SDK uses: actions/download-artifact@v4 with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ - github.workspace }}/sdk/${{ matrix.language }} + name: sdk.tar.gz + path: ${{ github.workspace}} + - name: UnTar SDK folder + run: tar -zxf ${{ github.workspace}}/sdk.tar.gz -C ${{github.workspace}}/sdk - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install dependencies - run: make install_${{ matrix.language}}_sdk + run: make install_nodejs_sdk - name: Install gotestfmt uses: GoTestTools/gotestfmt-action@v2 with: @@ -170,7 +169,7 @@ extraTests: - name: Make upstream run: make upstream - name: Run selected tests with manual web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=nodejs -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Configure AWS Credentials for OIDC uses: aws-actions/configure-aws-credentials@v4 with: @@ -180,19 +179,14 @@ extraTests: role-session-name: aws@githubActions role-to-assume: ${{ secrets.OIDC_ROLE_ARN }} - name: Run selected tests with configure-aws-credentials web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=nodejs -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - if: failure() && github.event_name == 'push' name: Notify Slack uses: 8398a7/action-slack@v3 with: - author_name: Failure in running ${{ matrix.language }} tests + author_name: Failure in running tests fields: repo,commit,author,action status: ${{ job.status }} - strategy: - fail-fast: false - matrix: - language: - - nodejs provider_test: name: provider_test @@ -236,11 +230,10 @@ extraTests: - name: Download SDK uses: actions/download-artifact@v4 with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ - github.workspace }}/sdk/${{ matrix.language }} + name: sdk.tar.gz + path: ${{ github.workspace}} + - name: UnTar SDK folder + run: tar -zxf ${{ github.workspace}}/sdk.tar.gz -C ${{github.workspace}}/sdk - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps @@ -248,7 +241,7 @@ extraTests: pip3 install virtualenv==20.0.23 pip3 install pipenv - name: Install dependencies - run: make install_${{ matrix.language}}_sdk + run: make install_sdks - name: Install gotestfmt uses: GoTestTools/gotestfmt-action@v2 with: @@ -263,22 +256,20 @@ extraTests: role-duration-seconds: 3600 role-session-name: aws@githubActions role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} + - name: Shard provider tests + working-directory: provider + run: go run github.com/blampe/shard --total ${{ strategy.job-total }} --index ${{ strategy.job-index }} > tests - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + working-directory: provider + run: xargs go test -v -json -count=1 -cover -timeout 2h -tags=all -parallel 4 {} < tests 2>&1 | tee /tmp/gotest.log | gotestfmt - if: failure() && github.event_name == 'push' name: Notify Slack uses: 8398a7/action-slack@v3 with: - author_name: Failure in running ${{ matrix.language }} provider tests + author_name: Failure in running provider tests fields: repo,commit,author,action status: ${{ job.status }} strategy: fail-fast: false matrix: - language: - - nodejs - - python - - dotnet - - go - - java + shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] diff --git a/provider-ci/test-providers/aws/.github/workflows/build_sdk.yml b/provider-ci/test-providers/aws/.github/workflows/build_sdk.yml index 5e209851e1..214c13973c 100644 --- a/provider-ci/test-providers/aws/.github/workflows/build_sdk.yml +++ b/provider-ci/test-providers/aws/.github/workflows/build_sdk.yml @@ -33,15 +33,6 @@ jobs: build_sdk: name: build_sdk runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - language: - - nodejs - - python - - dotnet - - go - - java steps: - name: Checkout Repo uses: actions/checkout@v4 @@ -63,8 +54,8 @@ jobs: run: make install_plugins - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Build SDK - run: make build_${{ matrix.language }} + - name: Build SDKs + run: make -j4 build_sdks - name: Check worktree clean uses: pulumi/git-status-check-action@v1 with: @@ -74,7 +65,11 @@ jobs: sdk/go/**/pulumiUtilities.go sdk/nodejs/package.json sdk/python/pyproject.toml + - name: Tar SDK folder + run: tar -zcf sdk.tar.gz -C sdk . - name: Upload SDK - uses: ./.github/actions/upload-sdk + uses: actions/upload-artifact@v4 with: - language: ${{ matrix.language }} + name: sdk.tar.gz + path: ${{ github.workspace}}/sdk.tar.gz + retention-days: 30 diff --git a/provider-ci/test-providers/aws/.github/workflows/master.yml b/provider-ci/test-providers/aws/.github/workflows/master.yml index f77eac7d9d..2f0d05e72e 100644 --- a/provider-ci/test-providers/aws/.github/workflows/master.yml +++ b/provider-ci/test-providers/aws/.github/workflows/master.yml @@ -261,10 +261,10 @@ jobs: - name: Download SDK uses: actions/download-artifact@v4 with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} + name: sdk.tar.gz + path: ${{ github.workspace}} + - name: UnTar SDK folder + run: tar -zxf ${{ github.workspace}}/sdk.tar.gz -C ${{github.workspace}}/sdk - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps @@ -272,7 +272,7 @@ jobs: pip3 install virtualenv==20.0.23 pip3 install pipenv - name: Install dependencies - run: make install_${{ matrix.language}}_sdk + run: make install_sdks - name: Install gotestfmt uses: GoTestTools/gotestfmt-action@v2 with: @@ -287,25 +287,33 @@ jobs: role-duration-seconds: 3600 role-session-name: aws@githubActions role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} + - name: Shard provider tests + run: go run github.com/blampe/shard --total ${{ strategy.job-total }} --index ${{ strategy.job-index }} > tests + working-directory: provider - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: xargs go test -v -json -count=1 -cover -timeout 2h -tags=all -parallel 4 {} < tests 2>&1 | tee /tmp/gotest.log | gotestfmt + working-directory: provider - if: failure() && github.event_name == 'push' name: Notify Slack uses: 8398a7/action-slack@v3 with: - author_name: Failure in running ${{ matrix.language }} provider tests + author_name: Failure in running provider tests fields: repo,commit,author,action status: ${{ job.status }} strategy: fail-fast: false matrix: - language: - - nodejs - - python - - dotnet - - go - - java + shard: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + - 9 test_oidc: name: test_oidc needs: build_sdk @@ -317,7 +325,7 @@ jobs: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main with: - dotnet: ${{ matrix.language != 'dotnet' }} + dotnet: false swap-storage: false tool-cache: false - name: Checkout Repo @@ -344,14 +352,14 @@ jobs: - name: Download SDK uses: actions/download-artifact@v4 with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} + name: sdk.tar.gz + path: ${{ github.workspace}} + - name: UnTar SDK folder + run: tar -zxf ${{ github.workspace}}/sdk.tar.gz -C ${{github.workspace}}/sdk - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install dependencies - run: make install_${{ matrix.language}}_sdk + run: make install_nodejs_sdk - name: Install gotestfmt uses: GoTestTools/gotestfmt-action@v2 with: @@ -360,7 +368,7 @@ jobs: - name: Make upstream run: make upstream - name: Run selected tests with manual web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=nodejs -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Configure AWS Credentials for OIDC uses: aws-actions/configure-aws-credentials@v4 with: @@ -370,19 +378,14 @@ jobs: role-to-assume: ${{ secrets.OIDC_ROLE_ARN }} unset-current-credentials: true - name: Run selected tests with configure-aws-credentials web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=nodejs -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - if: failure() && github.event_name == 'push' name: Notify Slack uses: 8398a7/action-slack@v3 with: - author_name: Failure in running ${{ matrix.language }} tests + author_name: Failure in running tests fields: repo,commit,author,action status: ${{ job.status }} - strategy: - fail-fast: false - matrix: - language: - - nodejs upstream_lint: name: Run upstream provider-lint runs-on: ubuntu-latest diff --git a/provider-ci/test-providers/aws/.github/workflows/prerelease.yml b/provider-ci/test-providers/aws/.github/workflows/prerelease.yml index 9ad63bcbf0..74f169b2ba 100644 --- a/provider-ci/test-providers/aws/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/aws/.github/workflows/prerelease.yml @@ -204,10 +204,10 @@ jobs: - name: Download SDK uses: actions/download-artifact@v4 with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} + name: sdk.tar.gz + path: ${{ github.workspace}} + - name: UnTar SDK folder + run: tar -zxf ${{ github.workspace}}/sdk.tar.gz -C ${{github.workspace}}/sdk - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps @@ -215,7 +215,7 @@ jobs: pip3 install virtualenv==20.0.23 pip3 install pipenv - name: Install dependencies - run: make install_${{ matrix.language}}_sdk + run: make install_sdks - name: Install gotestfmt uses: GoTestTools/gotestfmt-action@v2 with: @@ -230,25 +230,33 @@ jobs: role-duration-seconds: 3600 role-session-name: aws@githubActions role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} + - name: Shard provider tests + run: go run github.com/blampe/shard --total ${{ strategy.job-total }} --index ${{ strategy.job-index }} > tests + working-directory: provider - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: xargs go test -v -json -count=1 -cover -timeout 2h -tags=all -parallel 4 {} < tests 2>&1 | tee /tmp/gotest.log | gotestfmt + working-directory: provider - if: failure() && github.event_name == 'push' name: Notify Slack uses: 8398a7/action-slack@v3 with: - author_name: Failure in running ${{ matrix.language }} provider tests + author_name: Failure in running provider tests fields: repo,commit,author,action status: ${{ job.status }} strategy: fail-fast: false matrix: - language: - - nodejs - - python - - dotnet - - go - - java + shard: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + - 9 test_oidc: name: test_oidc needs: build_sdk @@ -260,7 +268,7 @@ jobs: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main with: - dotnet: ${{ matrix.language != 'dotnet' }} + dotnet: false swap-storage: false tool-cache: false - name: Checkout Repo @@ -287,14 +295,14 @@ jobs: - name: Download SDK uses: actions/download-artifact@v4 with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} + name: sdk.tar.gz + path: ${{ github.workspace}} + - name: UnTar SDK folder + run: tar -zxf ${{ github.workspace}}/sdk.tar.gz -C ${{github.workspace}}/sdk - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install dependencies - run: make install_${{ matrix.language}}_sdk + run: make install_nodejs_sdk - name: Install gotestfmt uses: GoTestTools/gotestfmt-action@v2 with: @@ -303,7 +311,7 @@ jobs: - name: Make upstream run: make upstream - name: Run selected tests with manual web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=nodejs -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Configure AWS Credentials for OIDC uses: aws-actions/configure-aws-credentials@v4 with: @@ -313,19 +321,14 @@ jobs: role-to-assume: ${{ secrets.OIDC_ROLE_ARN }} unset-current-credentials: true - name: Run selected tests with configure-aws-credentials web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=nodejs -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - if: failure() && github.event_name == 'push' name: Notify Slack uses: 8398a7/action-slack@v3 with: - author_name: Failure in running ${{ matrix.language }} tests + author_name: Failure in running tests fields: repo,commit,author,action status: ${{ job.status }} - strategy: - fail-fast: false - matrix: - language: - - nodejs upstream_lint: name: Run upstream provider-lint runs-on: ubuntu-latest diff --git a/provider-ci/test-providers/aws/.github/workflows/release.yml b/provider-ci/test-providers/aws/.github/workflows/release.yml index d1cc7837eb..7f65f1c6c1 100644 --- a/provider-ci/test-providers/aws/.github/workflows/release.yml +++ b/provider-ci/test-providers/aws/.github/workflows/release.yml @@ -203,10 +203,10 @@ jobs: - name: Download SDK uses: actions/download-artifact@v4 with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} + name: sdk.tar.gz + path: ${{ github.workspace}} + - name: UnTar SDK folder + run: tar -zxf ${{ github.workspace}}/sdk.tar.gz -C ${{github.workspace}}/sdk - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps @@ -214,7 +214,7 @@ jobs: pip3 install virtualenv==20.0.23 pip3 install pipenv - name: Install dependencies - run: make install_${{ matrix.language}}_sdk + run: make install_sdks - name: Install gotestfmt uses: GoTestTools/gotestfmt-action@v2 with: @@ -229,25 +229,33 @@ jobs: role-duration-seconds: 3600 role-session-name: aws@githubActions role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} + - name: Shard provider tests + run: go run github.com/blampe/shard --total ${{ strategy.job-total }} --index ${{ strategy.job-index }} > tests + working-directory: provider - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: xargs go test -v -json -count=1 -cover -timeout 2h -tags=all -parallel 4 {} < tests 2>&1 | tee /tmp/gotest.log | gotestfmt + working-directory: provider - if: failure() && github.event_name == 'push' name: Notify Slack uses: 8398a7/action-slack@v3 with: - author_name: Failure in running ${{ matrix.language }} provider tests + author_name: Failure in running provider tests fields: repo,commit,author,action status: ${{ job.status }} strategy: fail-fast: false matrix: - language: - - nodejs - - python - - dotnet - - go - - java + shard: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + - 9 test_oidc: name: test_oidc needs: build_sdk @@ -259,7 +267,7 @@ jobs: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main with: - dotnet: ${{ matrix.language != 'dotnet' }} + dotnet: false swap-storage: false tool-cache: false - name: Checkout Repo @@ -286,14 +294,14 @@ jobs: - name: Download SDK uses: actions/download-artifact@v4 with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} + name: sdk.tar.gz + path: ${{ github.workspace}} + - name: UnTar SDK folder + run: tar -zxf ${{ github.workspace}}/sdk.tar.gz -C ${{github.workspace}}/sdk - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install dependencies - run: make install_${{ matrix.language}}_sdk + run: make install_nodejs_sdk - name: Install gotestfmt uses: GoTestTools/gotestfmt-action@v2 with: @@ -302,7 +310,7 @@ jobs: - name: Make upstream run: make upstream - name: Run selected tests with manual web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=nodejs -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Configure AWS Credentials for OIDC uses: aws-actions/configure-aws-credentials@v4 with: @@ -312,19 +320,14 @@ jobs: role-to-assume: ${{ secrets.OIDC_ROLE_ARN }} unset-current-credentials: true - name: Run selected tests with configure-aws-credentials web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=nodejs -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - if: failure() && github.event_name == 'push' name: Notify Slack uses: 8398a7/action-slack@v3 with: - author_name: Failure in running ${{ matrix.language }} tests + author_name: Failure in running tests fields: repo,commit,author,action status: ${{ job.status }} - strategy: - fail-fast: false - matrix: - language: - - nodejs upstream_lint: name: Run upstream provider-lint runs-on: ubuntu-latest diff --git a/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml index 1208fddfa4..052b3f4686 100644 --- a/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml @@ -120,12 +120,6 @@ jobs: with: ref: ${{ env.PR_COMMIT_SHA }} submodules: true - - name: Checkout p/examples - if: matrix.testTarget == 'pulumiExamples' - uses: actions/checkout@v4 - with: - repository: pulumi/examples - path: p-examples - name: Setup tools uses: ./.github/actions/setup-tools with: @@ -134,9 +128,10 @@ jobs: uses: ./.github/actions/download-bin - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK - uses: ./.github/actions/download-sdk + uses: actions/download-artifact@v4 with: - language: ${{ matrix.language }} + name: sdk.tar.gz + path: ${{ github.workspace}} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps @@ -144,7 +139,7 @@ jobs: pip3 install virtualenv==20.0.23 pip3 install pipenv - name: Install dependencies - run: make install_${{ matrix.language}}_sdk + run: make install_sdks - name: Install gotestfmt uses: GoTestTools/gotestfmt-action@v2 with: @@ -161,23 +156,16 @@ jobs: role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - name: Make upstream run: make upstream + - name: Shard tests + working-directory: examples + run: go run github.com/blampe/shard --total ${{ strategy.job-total }} --index ${{ strategy.job-index }} > tests - name: Run tests - if: matrix.testTarget == 'local' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - name: Run pulumi/examples tests - if: matrix.testTarget == 'pulumiExamples' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -run TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + working-directory: examples + run: xargs go test -v -json -count=1 -cover -timeout 2h -tags=all -parallel 4 {} < tests 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: fail-fast: false matrix: - language: - - nodejs - - python - - dotnet - - go - - java - testTarget: [local] + shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] license_check: name: License Check uses: ./.github/workflows/license.yml @@ -251,10 +239,10 @@ jobs: - name: Download SDK uses: actions/download-artifact@v4 with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} + name: sdk.tar.gz + path: ${{ github.workspace}} + - name: UnTar SDK folder + run: tar -zxf ${{ github.workspace}}/sdk.tar.gz -C ${{github.workspace}}/sdk - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps @@ -262,7 +250,7 @@ jobs: pip3 install virtualenv==20.0.23 pip3 install pipenv - name: Install dependencies - run: make install_${{ matrix.language}}_sdk + run: make install_sdks - name: Install gotestfmt uses: GoTestTools/gotestfmt-action@v2 with: @@ -277,25 +265,33 @@ jobs: role-duration-seconds: 3600 role-session-name: aws@githubActions role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} + - name: Shard provider tests + run: go run github.com/blampe/shard --total ${{ strategy.job-total }} --index ${{ strategy.job-index }} > tests + working-directory: provider - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: xargs go test -v -json -count=1 -cover -timeout 2h -tags=all -parallel 4 {} < tests 2>&1 | tee /tmp/gotest.log | gotestfmt + working-directory: provider - if: failure() && github.event_name == 'push' name: Notify Slack uses: 8398a7/action-slack@v3 with: - author_name: Failure in running ${{ matrix.language }} provider tests + author_name: Failure in running provider tests fields: repo,commit,author,action status: ${{ job.status }} strategy: fail-fast: false matrix: - language: - - nodejs - - python - - dotnet - - go - - java + shard: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + - 9 test_oidc: name: test_oidc needs: build_sdk @@ -307,7 +303,7 @@ jobs: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main with: - dotnet: ${{ matrix.language != 'dotnet' }} + dotnet: false swap-storage: false tool-cache: false - name: Checkout Repo @@ -334,14 +330,14 @@ jobs: - name: Download SDK uses: actions/download-artifact@v4 with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} + name: sdk.tar.gz + path: ${{ github.workspace}} + - name: UnTar SDK folder + run: tar -zxf ${{ github.workspace}}/sdk.tar.gz -C ${{github.workspace}}/sdk - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install dependencies - run: make install_${{ matrix.language}}_sdk + run: make install_nodejs_sdk - name: Install gotestfmt uses: GoTestTools/gotestfmt-action@v2 with: @@ -350,7 +346,7 @@ jobs: - name: Make upstream run: make upstream - name: Run selected tests with manual web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=nodejs -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Configure AWS Credentials for OIDC uses: aws-actions/configure-aws-credentials@v4 with: @@ -360,19 +356,14 @@ jobs: role-to-assume: ${{ secrets.OIDC_ROLE_ARN }} unset-current-credentials: true - name: Run selected tests with configure-aws-credentials web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=nodejs -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - if: failure() && github.event_name == 'push' name: Notify Slack uses: 8398a7/action-slack@v3 with: - author_name: Failure in running ${{ matrix.language }} tests + author_name: Failure in running tests fields: repo,commit,author,action status: ${{ job.status }} - strategy: - fail-fast: false - matrix: - language: - - nodejs upstream_lint: name: Run upstream provider-lint runs-on: ubuntu-latest diff --git a/provider-ci/test-providers/cloudflare/.ci-mgmt.yaml b/provider-ci/test-providers/cloudflare/.ci-mgmt.yaml index e52578e758..9b1373aed5 100644 --- a/provider-ci/test-providers/cloudflare/.ci-mgmt.yaml +++ b/provider-ci/test-providers/cloudflare/.ci-mgmt.yaml @@ -16,12 +16,4 @@ env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} team: ecosystem -actions: - preTest: - - name: make upstream - run: | - make upstream - - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt pulumiConvert: 1 diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/build_sdk.yml b/provider-ci/test-providers/cloudflare/.github/workflows/build_sdk.yml index 36b673fd54..1b6a1add63 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/build_sdk.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/build_sdk.yml @@ -32,15 +32,6 @@ jobs: build_sdk: name: build_sdk runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - language: - - nodejs - - python - - dotnet - - go - - java steps: - name: Checkout Repo uses: actions/checkout@v4 @@ -60,8 +51,8 @@ jobs: run: make install_plugins - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Build SDK - run: make build_${{ matrix.language }} + - name: Build SDKs + run: make -j4 build_sdks - name: Check worktree clean uses: pulumi/git-status-check-action@v1 with: @@ -71,7 +62,11 @@ jobs: sdk/go/**/pulumiUtilities.go sdk/nodejs/package.json sdk/python/pyproject.toml + - name: Tar SDK folder + run: tar -zcf sdk.tar.gz -C sdk . - name: Upload SDK - uses: ./.github/actions/upload-sdk + uses: actions/upload-artifact@v4 with: - language: ${{ matrix.language }} + name: sdk.tar.gz + path: ${{ github.workspace}}/sdk.tar.gz + retention-days: 30 diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/master.yml b/provider-ci/test-providers/cloudflare/.github/workflows/master.yml index c89bd645b7..c4076c0034 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/master.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/master.yml @@ -159,12 +159,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} version: v2.5.0 - - name: make upstream - run: | - make upstream - - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Run tests run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml b/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml index 657854b94f..20832c96dd 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml @@ -104,12 +104,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} version: v2.5.0 - - name: make upstream - run: | - make upstream - - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Run tests run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/release.yml b/provider-ci/test-providers/cloudflare/.github/workflows/release.yml index d68897f71a..416b893d7d 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/release.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/release.yml @@ -103,12 +103,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} version: v2.5.0 - - name: make upstream - run: | - make upstream - - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Run tests run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml index e63ffa76a0..303c976d94 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml @@ -115,12 +115,6 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ env.PR_COMMIT_SHA }} - - name: Checkout p/examples - if: matrix.testTarget == 'pulumiExamples' - uses: actions/checkout@v4 - with: - repository: pulumi/examples - path: p-examples - name: Setup tools uses: ./.github/actions/setup-tools with: @@ -129,9 +123,10 @@ jobs: uses: ./.github/actions/download-bin - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK - uses: ./.github/actions/download-sdk + uses: actions/download-artifact@v4 with: - language: ${{ matrix.language }} + name: sdk.tar.gz + path: ${{ github.workspace}} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps @@ -139,35 +134,22 @@ jobs: pip3 install virtualenv==20.0.23 pip3 install pipenv - name: Install dependencies - run: make install_${{ matrix.language}}_sdk + run: make install_sdks - name: Install gotestfmt uses: GoTestTools/gotestfmt-action@v2 with: token: ${{ secrets.GITHUB_TOKEN }} version: v2.5.0 - - name: make upstream - run: | - make upstream - - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + - name: Shard tests + working-directory: examples + run: go run github.com/blampe/shard --total ${{ strategy.job-total }} --index ${{ strategy.job-index }} > tests - name: Run tests - if: matrix.testTarget == 'local' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - name: Run pulumi/examples tests - if: matrix.testTarget == 'pulumiExamples' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -run TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + working-directory: examples + run: xargs go test -v -json -count=1 -cover -timeout 2h -tags=all -parallel 4 {} < tests 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: fail-fast: false matrix: - language: - - nodejs - - python - - dotnet - - go - - java - testTarget: [local] + shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] license_check: name: License Check uses: ./.github/workflows/license.yml diff --git a/provider-ci/test-providers/docker/.github/workflows/build_sdk.yml b/provider-ci/test-providers/docker/.github/workflows/build_sdk.yml index 45fa494e3e..143cb86b7b 100644 --- a/provider-ci/test-providers/docker/.github/workflows/build_sdk.yml +++ b/provider-ci/test-providers/docker/.github/workflows/build_sdk.yml @@ -45,15 +45,6 @@ jobs: build_sdk: name: build_sdk runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - language: - - nodejs - - python - - dotnet - - go - - java steps: - name: Checkout Repo uses: actions/checkout@v4 @@ -73,8 +64,8 @@ jobs: run: make install_plugins - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Build SDK - run: make build_${{ matrix.language }} + - name: Build SDKs + run: make -j4 build_sdks - name: Check worktree clean uses: pulumi/git-status-check-action@v1 with: @@ -84,7 +75,11 @@ jobs: sdk/go/**/pulumiUtilities.go sdk/nodejs/package.json sdk/python/pyproject.toml + - name: Tar SDK folder + run: tar -zcf sdk.tar.gz -C sdk . - name: Upload SDK - uses: ./.github/actions/upload-sdk + uses: actions/upload-artifact@v4 with: - language: ${{ matrix.language }} + name: sdk.tar.gz + path: ${{ github.workspace}}/sdk.tar.gz + retention-days: 30 diff --git a/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml index 22f4ab356d..eeb3ed3d03 100644 --- a/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml @@ -128,12 +128,6 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ env.PR_COMMIT_SHA }} - - name: Checkout p/examples - if: matrix.testTarget == 'pulumiExamples' - uses: actions/checkout@v4 - with: - repository: pulumi/examples - path: p-examples - name: Setup tools uses: ./.github/actions/setup-tools with: @@ -142,9 +136,10 @@ jobs: uses: ./.github/actions/download-bin - run: dotnet nuget add source ${{ github.workspace }}/nuget - name: Download SDK - uses: ./.github/actions/download-sdk + uses: actions/download-artifact@v4 with: - language: ${{ matrix.language }} + name: sdk.tar.gz + path: ${{ github.workspace}} - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps @@ -175,7 +170,7 @@ jobs: - name: Login to Google Cloud Registry run: gcloud --quiet auth configure-docker - name: Install dependencies - run: make install_${{ matrix.language}}_sdk + run: make install_sdks - name: Install gotestfmt uses: GoTestTools/gotestfmt-action@v2 with: @@ -185,23 +180,16 @@ jobs: uses: webfactory/ssh-agent@v0.7.0 with: ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }} + - name: Shard tests + working-directory: examples + run: go run github.com/blampe/shard --total ${{ strategy.job-total }} --index ${{ strategy.job-index }} > tests - name: Run tests - if: matrix.testTarget == 'local' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - name: Run pulumi/examples tests - if: matrix.testTarget == 'pulumiExamples' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -run TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + working-directory: examples + run: xargs go test -v -json -count=1 -cover -timeout 2h -tags=all -parallel 4 {} < tests 2>&1 | tee /tmp/gotest.log | gotestfmt strategy: fail-fast: false matrix: - language: - - nodejs - - python - - dotnet - - go - - java - testTarget: [local] + shard: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] license_check: name: License Check uses: ./.github/workflows/license.yml