From f658bfbb3b1797479c6eac1e1e1d1928062376f7 Mon Sep 17 00:00:00 2001 From: Ian Wahbe Date: Mon, 28 Aug 2023 12:33:24 -0700 Subject: [PATCH] Begin normalizing workflow files, based off of pulumi/ci-mgmt/#518 (#2708) This PR is based off of https://github.com/pulumi/ci-mgmt/pull/518. The Makefile has greater changes, which will be handled in a separate PR. There are outstanding changes in these files: - [ ] Makefile - [x] .github/workflows/main.yml - [x] .github/workflows/master.yml - [x] .github/workflows/nightly-test.yml - [x] .github/workflows/prerelease.yml - [x] .github/workflows/release.yml - [x] .github/workflows/run-acceptance-tests.yml - [x] .github/workflows/update-bridge.yml - [X] .github/workflows/command-dispatch.yml - [X] .github/workflows/community-moderation.yml - [X] .github/workflows/pull-request.yml - [X] .github/workflows/resync-build.yml - [X] .github/workflows/upgrade-bridge.yml - [X] .github/workflows/upgrade-provider.yml - [X] .goreleaser.prerelease.yml - [X] .goreleaser.yml - [X] .upgrade-config.yml - [X] scripts/upstream.sh We will merge as soon as we release v6. I expect the Makefile normalization to occur later. --- .github/workflows/command-dispatch.yml | 14 +- .github/workflows/community-moderation.yml | 6 +- .github/workflows/main.yml | 347 ++++++------------- .github/workflows/master.yml | 367 +++++---------------- .github/workflows/nightly-test.yml | 141 +++----- .github/workflows/prerelease.yml | 341 +++++-------------- .github/workflows/pull-request.yml | 17 +- .github/workflows/release.yml | 351 +++++--------------- .github/workflows/resync-build.yml | 123 +++++++ .github/workflows/run-acceptance-tests.yml | 145 ++++---- .github/workflows/update-bridge.yml | 39 +-- .github/workflows/upgrade-bridge.yml | 41 +++ .github/workflows/upgrade-provider.yml | 45 +++ .goreleaser.prerelease.yml | 7 +- .goreleaser.yml | 4 + .upgrade-config.yml | 8 + scripts/upstream.sh | 197 +++++++++++ 17 files changed, 940 insertions(+), 1253 deletions(-) create mode 100644 .github/workflows/resync-build.yml create mode 100644 .github/workflows/upgrade-bridge.yml create mode 100644 .github/workflows/upgrade-provider.yml create mode 100644 .upgrade-config.yml create mode 100644 scripts/upstream.sh diff --git a/.github/workflows/command-dispatch.yml b/.github/workflows/command-dispatch.yml index e5b93415319..64b9f0cc40b 100644 --- a/.github/workflows/command-dispatch.yml +++ b/.github/workflows/command-dispatch.yml @@ -1,10 +1,18 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + env: + PROVIDER: aws AWS_REGION: us-west-2 + DOTNETVERSION: | + 6.0.x + 3.1.301 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GOVERSION: 1.20.1 + JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODEVERSION: 16.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} - PROVIDER: aws PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} PUBLISH_REPO_USERNAME: ${{ secrets.OSSRH_USERNAME }} PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} @@ -13,10 +21,12 @@ env: PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget PULUMI_MISSING_DOCS_ERROR: true PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + PYTHONVERSION: "3.9" SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }} SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }} SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + TF_APPEND_USER_AGENT: pulumi TRAVIS_OS_NAME: linux jobs: command-dispatch-for-testing: @@ -25,6 +35,8 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v3 + with: + submodules: true - uses: peter-evans/slash-command-dispatch@v2 with: commands: run-acceptance-tests diff --git a/.github/workflows/community-moderation.yml b/.github/workflows/community-moderation.yml index 3b5dd348a62..e6bc92c8e1e 100644 --- a/.github/workflows/community-moderation.yml +++ b/.github/workflows/community-moderation.yml @@ -1,3 +1,5 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: @@ -7,6 +9,8 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v3 + with: + submodules: true - id: schema_changed name: Check for diff in schema uses: dorny/paths-filter@v2 @@ -21,7 +25,7 @@ jobs: - if: steps.sdk_changed.outputs.changed == 'true' && github.event.pull_request.head.repo.full_name != github.repository name: Send codegen warning as comment on PR - uses: thollander/actions-comment-pull-request@v1 + uses: thollander/actions-comment-pull-request@v2 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} message: > diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0e07a449506..74105492c09 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,13 +1,18 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + env: + PROVIDER: aws AWS_REGION: us-west-2 DOTNETVERSION: | - 6.0.x - 3.1.301 + 6.0.x + 3.1.301 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GOVERSION: 1.20.1 + JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODEVERSION: 16.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} - PROVIDER: aws PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} PUBLISH_REPO_USERNAME: ${{ secrets.OSSRH_USERNAME }} PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} @@ -16,10 +21,12 @@ env: PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget PULUMI_MISSING_DOCS_ERROR: true PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + PYTHONVERSION: "3.9" SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }} SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }} SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + TF_APPEND_USER_AGENT: pulumi TRAVIS_OS_NAME: linux jobs: build_sdk: @@ -29,6 +36,8 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v3 + with: + submodules: true - name: Checkout Scripts Repo uses: actions/checkout@v3 with: @@ -39,9 +48,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -53,7 +62,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v2 with: - node-version: ${{matrix.nodeversion}} + node-version: ${{ env.NODEVERSION }} registry-url: https://registry.npmjs.org - name: Setup DotNet uses: actions/setup-dotnet@v1 @@ -62,17 +71,16 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: ${{matrix.pythonversion}} + python-version: ${{ env.PYTHONVERSION }} - name: Setup Java uses: actions/setup-java@v3 with: cache: gradle distribution: temurin - java-version: ${{matrix.javaversion}} + java-version: ${{ env.JAVAVERSION }} - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: - # Pin to known good version until #2262 is resolved gradle-version: "7.6" - name: Download provider + tfgen binaries uses: actions/download-artifact@v2 @@ -88,10 +96,10 @@ jobs: - name: Install plugins run: make install_plugins - name: Update path - run: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Set PACKAGE_VERSION to Env run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >> - $GITHUB_ENV + "$GITHUB_ENV" - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean @@ -114,20 +122,12 @@ jobs: strategy: fail-fast: true matrix: - goversion: - - 1.20.x - javaversion: - - "11" language: - nodejs - python - dotnet - go - java - nodeversion: - - 16.x - pythonversion: - - "3.9" generate_coverage_data: continue-on-error: true env: @@ -138,6 +138,8 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v3 + with: + submodules: true - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: @@ -154,9 +156,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -169,7 +171,7 @@ jobs: name: Install Schema Tools uses: jaxxstorm/action-install-gh-release@v1.5.0 with: - repo: mikhailshilkov/schema-tools + repo: pulumi/schema-tools - name: Echo Coverage Output Dir run: 'echo "Coverage output directory: ${{ env.COVERAGE_OUTPUT_DIR }}"' - name: Generate Coverage Data @@ -178,22 +180,19 @@ jobs: run: cat ${{ env.COVERAGE_OUTPUT_DIR }}/shortSummary.txt - name: Upload coverage data to S3 run: >- - summaryName="${PROVIDER}_summary_`date +"%Y-%m-%d_%H-%M-%S"`.json" + summaryName="${PROVIDER}_summary_$(date +"%Y-%m-%d_%H-%M-%S").json" s3FullURI="s3://${{ secrets.S3_COVERAGE_BUCKET_NAME }}/summaries/${summaryName}" - aws s3 cp ${{ env.COVERAGE_OUTPUT_DIR }}/summary.json ${s3FullURI} --acl bucket-owner-full-control - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x + aws s3 cp "${{ env.COVERAGE_OUTPUT_DIR }}/summary.json" "${s3FullURI}" --acl bucket-owner-full-control prerequisites: name: prerequisites runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@v3 + with: + submodules: true - name: Checkout Scripts Repo uses: actions/checkout@v3 with: @@ -204,9 +203,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -219,26 +218,33 @@ jobs: name: Install Schema Tools uses: jaxxstorm/action-install-gh-release@v1.5.0 with: - repo: mikhailshilkov/schema-tools + repo: pulumi/schema-tools - name: Build tfgen & provider binaries run: make provider - if: github.event_name == 'pull_request' name: Check Schema is Valid - run: >- - echo 'SCHEMA_CHANGES<> $GITHUB_ENV - - schema-tools compare ${{ env.PROVIDER }} master --local-path=provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> $GITHUB_ENV - - echo 'EOF' >> $GITHUB_ENV - - if: github.event_name == 'pull_request' + run: | + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + { + echo "SCHEMA_CHANGES<<$EOF"; + schema-tools compare -p ${{ env.PROVIDER }} -o ${{ github.event.repository.default_branch }} -n --local-path=provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json; + echo "$EOF"; + } >> "$GITHUB_ENV" + - if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' name: Comment on PR with Details of Schema Check - uses: thollander/actions-comment-pull-request@v1 + uses: thollander/actions-comment-pull-request@v2 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - message: | + comment_tag: schemaCheck + message: >+ ### Does the PR have any schema changes? + ${{ env.SCHEMA_CHANGES }} + + + Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. + - name: Tar provider binaries run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }} @@ -256,30 +262,25 @@ jobs: author_name: Failure in building provider prerequisites fields: repo,commit,author,action status: ${{ job.status }} - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - nodeversion: - - 16.x - pythonversion: - - "3.9" publish: name: publish - needs: test + needs: + - test + - go_test_shim runs-on: pulumi-ubuntu-8core steps: - name: Checkout Repo uses: actions/checkout@v3 + with: + submodules: true - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -299,8 +300,7 @@ jobs: role-session-name: ${{ env.PROVIDER }}@githubActions role-to-assume: ${{ secrets.AWS_UPLOAD_ROLE_ARN }} - name: Set PreRelease Version - run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" - >> $GITHUB_ENV + run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> "$GITHUB_ENV" - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: @@ -314,188 +314,24 @@ jobs: author_name: Failure in publishing binaries fields: repo,commit,author,action status: ${{ job.status }} - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - nodeversion: - - 16.x - pythonversion: - - "3.9" - publish_java_sdk: - continue-on-error: true - name: publish_java_sdk - needs: publish - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - name: Checkout Scripts Repo - uses: actions/checkout@v3 - with: - path: ci-scripts - repository: pulumi/scripts - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: ${{matrix.goversion}} - cache-dependency-path: | - sdk/go.sum - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.5.0 - with: - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/actions@v4 - with: - pulumi-version: v3.77.1 - - name: Setup Java - uses: actions/setup-java@v3 - with: - cache: gradle - distribution: temurin - java-version: ${{matrix.javaversion}} - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - with: - # Pin to known good version until #2262 is resolved - gradle-version: "7.6" - - name: Download java SDK - uses: actions/download-artifact@v2 - with: - name: java-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress java SDK - run: tar -zxf ${{github.workspace}}/sdk/java.tar.gz -C - ${{github.workspace}}/sdk/java - - name: Set PACKAGE_VERSION to Env - run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >> - $GITHUB_ENV - - name: Publish Java SDK - uses: gradle/gradle-build-action@9b814496b50909128c6a52622b416c5ffa04db49 - with: - arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository - build-root-directory: ./sdk/java - gradle-version: 7.4.1 - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - javaversion: - - "11" publish_sdk: name: publish_sdk needs: publish runs-on: ubuntu-latest steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - name: Checkout Scripts Repo - uses: actions/checkout@v3 - with: - path: ci-scripts - repository: pulumi/scripts - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: ${{matrix.goversion}} - cache-dependency-path: | - sdk/go.sum - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.5.0 - with: - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/actions@v4 - with: - pulumi-version: v3.77.1 - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: ${{matrix.nodeversion}} - registry-url: https://registry.npmjs.org - - name: Setup DotNet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ env.DOTNETVERSION }} - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{matrix.pythonversion}} - - name: Download python SDK - uses: actions/download-artifact@v2 - with: - name: python-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress python SDK - run: tar -zxf ${{github.workspace}}/sdk/python.tar.gz -C - ${{github.workspace}}/sdk/python - - name: Download dotnet SDK - uses: actions/download-artifact@v2 - with: - name: dotnet-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress dotnet SDK - run: tar -zxf ${{github.workspace}}/sdk/dotnet.tar.gz -C - ${{github.workspace}}/sdk/dotnet - - name: Download nodejs SDK - uses: actions/download-artifact@v2 - with: - name: nodejs-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress nodejs SDK - run: tar -zxf ${{github.workspace}}/sdk/nodejs.tar.gz -C - ${{github.workspace}}/sdk/nodejs - - run: python -m pip install pip twine + - name: Publish SDKs + uses: pulumi/pulumi-package-publisher@v0.0.9 - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish SDKs - run: ./ci-scripts/ci/publish-tfgen-package ${{ github.workspace }} - - if: failure() && github.event_name == 'push' - name: Notify Slack - uses: 8398a7/action-slack@v3 - with: - author_name: Failure in publishing SDK - fields: repo,commit,author,action - status: ${{ job.status }} - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - nodeversion: - - 16.x - pythonversion: - - "3.9" - - - go_test_shim: - if: github.event_name == 'repository_dispatch' || - github.event.pull_request.head.repo.full_name == github.repository - name: Run test of provider shim - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: actions/setup-go@v4 - with: - go-version-file: 'provider/shim/go.mod' - cache-dependency-path: 'provider/shim/go.sum' - - name: go test - run: | - cd provider/shim - go test -v . - + SLACK_CHANNEL: provider-upgrade-publish-status + SLACK_COLOR: "#FF0000" + SLACK_ICON_EMOJI: ":taco:" + SLACK_MESSAGE: "Publish failed :x:" + SLACK_TITLE: ${{ github.event.repository.name }} upgrade result + SLACK_USERNAME: provider-bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: failure() + name: Send Publish Failure To Slack + uses: rtCamp/action-slack-notify@v2 test: name: test needs: build_sdk @@ -506,6 +342,8 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v3 + with: + submodules: true - name: Checkout Scripts Repo uses: actions/checkout@v3 with: @@ -516,9 +354,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -530,7 +368,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v2 with: - node-version: ${{matrix.nodeversion}} + node-version: ${{ env.NODEVERSION }} registry-url: https://registry.npmjs.org - name: Setup DotNet uses: actions/setup-dotnet@v1 @@ -539,17 +377,16 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: ${{matrix.pythonversion}} + python-version: ${{ env.PYTHONVERSION }} - name: Setup Java uses: actions/setup-java@v3 with: cache: gradle distribution: temurin - java-version: ${{matrix.javaversion}} + java-version: ${{ env.JAVAVERSION }} - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: - # Pin to known good version until #2262 is resolved gradle-version: "7.6" - name: Download provider + tfgen binaries uses: actions/download-artifact@v2 @@ -572,11 +409,18 @@ jobs: run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} - name: Update path - run: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps run: |- pip3 install virtualenv==20.0.23 pip3 install pipenv + - name: Install dependencies + run: make install_${{ matrix.language}}_sdk + - name: Install gotestfmt + uses: GoTestTools/gotestfmt-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: v2.4.0 - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: @@ -586,13 +430,6 @@ jobs: role-duration-seconds: 3600 role-session-name: ${{ env.PROVIDER }}@githubActions role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.4.0 - 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 @@ -604,22 +441,34 @@ jobs: fields: repo,commit,author,action status: ${{ job.status }} strategy: - fail-fast: true + fail-fast: false matrix: - goversion: - - 1.20.x - javaversion: - - "11" language: - nodejs - python - dotnet - go - java - nodeversion: - - 16.x - pythonversion: - - "3.9" + go_test_shim: + if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository + name: Run test of provider shim + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + ref: ${{ env.PR_COMMIT_SHA }} + submodules: true + - uses: actions/setup-go@v4 + with: + cache-dependency-path: provider/shim/go.sum + go-version-file: provider/shim/go.mod + - name: go test + run: | + cd provider/shim + go test -v . + timeout-minutes: 60 + name: main on: push: diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 3a414d211d0..7d0838fcc8b 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -1,13 +1,18 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + env: + PROVIDER: aws AWS_REGION: us-west-2 DOTNETVERSION: | - 6.0.x - 3.1.301 + 6.0.x + 3.1.301 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GOVERSION: 1.20.1 + JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODEVERSION: 16.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} - PROVIDER: aws PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} PUBLISH_REPO_USERNAME: ${{ secrets.OSSRH_USERNAME }} PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} @@ -16,10 +21,12 @@ env: PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget PULUMI_MISSING_DOCS_ERROR: true PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + PYTHONVERSION: "3.9" SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }} SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }} SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + TF_APPEND_USER_AGENT: pulumi TRAVIS_OS_NAME: linux jobs: build_sdk: @@ -41,9 +48,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -55,7 +62,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v2 with: - node-version: ${{matrix.nodeversion}} + node-version: ${{ env.NODEVERSION }} registry-url: https://registry.npmjs.org - name: Setup DotNet uses: actions/setup-dotnet@v1 @@ -64,17 +71,16 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: ${{matrix.pythonversion}} + python-version: ${{ env.PYTHONVERSION }} - name: Setup Java uses: actions/setup-java@v3 with: cache: gradle distribution: temurin - java-version: ${{matrix.javaversion}} + java-version: ${{ env.JAVAVERSION }} - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: - # Pin to known good version until #2262 is resolved gradle-version: "7.6" - name: Download provider + tfgen binaries uses: actions/download-artifact@v2 @@ -90,10 +96,10 @@ jobs: - name: Install plugins run: make install_plugins - name: Update path - run: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Set PACKAGE_VERSION to Env run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >> - $GITHUB_ENV + "$GITHUB_ENV" - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean @@ -116,20 +122,12 @@ jobs: strategy: fail-fast: true matrix: - goversion: - - 1.20.x - javaversion: - - "11" language: - nodejs - python - dotnet - go - java - nodeversion: - - 16.x - pythonversion: - - "3.9" generate_coverage_data: continue-on-error: true env: @@ -158,9 +156,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -173,18 +171,7 @@ jobs: name: Install Schema Tools uses: jaxxstorm/action-install-gh-release@v1.5.0 with: - repo: mikhailshilkov/schema-tools - - name: Clear GitHub Actions Ubuntu runner disk space - uses: jlumbroso/free-disk-space@main - with: - tool-cache: false - dotnet: false - android: true - haskell: true - swap-storage: true - # TODO: enable once transient error with azure is resolved - # E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/universe/d/dotnet7/aspnetcore-targeting-pack-7.0_7.0.105-0ubuntu1%7e22.04.1_amd64.deb 404 Not Found [IP: 40.81.13.82 80] - large-packages: false + repo: pulumi/schema-tools - name: Echo Coverage Output Dir run: 'echo "Coverage output directory: ${{ env.COVERAGE_OUTPUT_DIR }}"' - name: Generate Coverage Data @@ -193,16 +180,11 @@ jobs: run: cat ${{ env.COVERAGE_OUTPUT_DIR }}/shortSummary.txt - name: Upload coverage data to S3 run: >- - summaryName="${PROVIDER}_summary_`date +"%Y-%m-%d_%H-%M-%S"`.json" + summaryName="${PROVIDER}_summary_$(date +"%Y-%m-%d_%H-%M-%S").json" s3FullURI="s3://${{ secrets.S3_COVERAGE_BUCKET_NAME }}/summaries/${summaryName}" - aws s3 cp ${{ env.COVERAGE_OUTPUT_DIR }}/summary.json ${s3FullURI} --acl bucket-owner-full-control - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x + aws s3 cp "${{ env.COVERAGE_OUTPUT_DIR }}/summary.json" "${s3FullURI}" --acl bucket-owner-full-control prerequisites: name: prerequisites runs-on: ubuntu-latest @@ -221,14 +203,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: ${{matrix.nodeversion}} - registry-url: https://registry.npmjs.org + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -241,37 +218,33 @@ jobs: name: Install Schema Tools uses: jaxxstorm/action-install-gh-release@v1.5.0 with: - repo: mikhailshilkov/schema-tools - - name: Clear GitHub Actions Ubuntu runner disk space - uses: jlumbroso/free-disk-space@main - with: - tool-cache: false - dotnet: false - android: true - haskell: true - swap-storage: true - # TODO: enable once transient error with azure is resolved - # E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/universe/d/dotnet7/aspnetcore-targeting-pack-7.0_7.0.105-0ubuntu1%7e22.04.1_amd64.deb 404 Not Found [IP: 40.81.13.82 80] - large-packages: false + repo: pulumi/schema-tools - name: Build tfgen & provider binaries run: make provider - if: github.event_name == 'pull_request' name: Check Schema is Valid - run: >- - echo 'SCHEMA_CHANGES<> $GITHUB_ENV - - schema-tools compare ${{ env.PROVIDER }} master --local-path=provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> $GITHUB_ENV - - echo 'EOF' >> $GITHUB_ENV - - if: github.event_name == 'pull_request' + run: | + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + { + echo "SCHEMA_CHANGES<<$EOF"; + schema-tools compare -p ${{ env.PROVIDER }} -o ${{ github.event.repository.default_branch }} -n --local-path=provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json; + echo "$EOF"; + } >> "$GITHUB_ENV" + - if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' name: Comment on PR with Details of Schema Check - uses: thollander/actions-comment-pull-request@v1 + uses: thollander/actions-comment-pull-request@v2 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - message: | + comment_tag: schemaCheck + message: >+ ### Does the PR have any schema changes? + ${{ env.SCHEMA_CHANGES }} + + + Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. + - name: Tar provider binaries run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }} @@ -289,18 +262,11 @@ jobs: author_name: Failure in building provider prerequisites fields: repo,commit,author,action status: ${{ job.status }} - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - nodeversion: - - 16.x - pythonversion: - - "3.9" publish: name: publish - needs: test + needs: + - test + - go_test_shim runs-on: pulumi-ubuntu-8core steps: - name: Checkout Repo @@ -312,9 +278,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -334,7 +300,7 @@ jobs: role-session-name: ${{ env.PROVIDER }}@githubActions role-to-assume: ${{ secrets.AWS_UPLOAD_ROLE_ARN }} - name: Set PreRelease Version - run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> $GITHUB_ENV + run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> "$GITHUB_ENV" - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: @@ -348,191 +314,24 @@ jobs: author_name: Failure in publishing binaries fields: repo,commit,author,action status: ${{ job.status }} - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - nodeversion: - - 16.x - pythonversion: - - "3.9" - publish_java_sdk: - continue-on-error: true - name: publish_java_sdk - needs: publish - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - submodules: true - - name: Checkout Scripts Repo - uses: actions/checkout@v3 - with: - path: ci-scripts - repository: pulumi/scripts - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: ${{matrix.goversion}} - cache-dependency-path: | - sdk/go.sum - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.5.0 - with: - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/actions@v4 - with: - pulumi-version: v3.77.1 - - name: Setup Java - uses: actions/setup-java@v3 - with: - cache: gradle - distribution: temurin - java-version: ${{matrix.javaversion}} - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - with: - # Pin to known good version until #2262 is resolved - gradle-version: "7.6" - - name: Download java SDK - uses: actions/download-artifact@v2 - with: - name: java-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress java SDK - run: tar -zxf ${{github.workspace}}/sdk/java.tar.gz -C - ${{github.workspace}}/sdk/java - - name: Set PACKAGE_VERSION to Env - run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >> - $GITHUB_ENV - - name: Publish Java SDK - uses: gradle/gradle-build-action@9b814496b50909128c6a52622b416c5ffa04db49 - with: - arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository - build-root-directory: ./sdk/java - gradle-version: 7.4.1 - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - javaversion: - - "11" publish_sdk: name: publish_sdk needs: publish runs-on: ubuntu-latest steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - submodules: true - - name: Checkout Scripts Repo - uses: actions/checkout@v3 - with: - path: ci-scripts - repository: pulumi/scripts - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: ${{matrix.goversion}} - cache-dependency-path: | - sdk/go.sum - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.5.0 - with: - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/actions@v4 - with: - pulumi-version: v3.77.1 - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: ${{matrix.nodeversion}} - registry-url: https://registry.npmjs.org - - name: Setup DotNet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ env.DOTNETVERSION }} - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{matrix.pythonversion}} - - name: Download python SDK - uses: actions/download-artifact@v2 - with: - name: python-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress python SDK - run: tar -zxf ${{github.workspace}}/sdk/python.tar.gz -C - ${{github.workspace}}/sdk/python - - name: Download dotnet SDK - uses: actions/download-artifact@v2 - with: - name: dotnet-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress dotnet SDK - run: tar -zxf ${{github.workspace}}/sdk/dotnet.tar.gz -C - ${{github.workspace}}/sdk/dotnet - - name: Download nodejs SDK - uses: actions/download-artifact@v2 - with: - name: nodejs-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress nodejs SDK - run: tar -zxf ${{github.workspace}}/sdk/nodejs.tar.gz -C - ${{github.workspace}}/sdk/nodejs - - run: python -m pip install pip twine + - name: Publish SDKs + uses: pulumi/pulumi-package-publisher@v0.0.9 - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish SDKs - run: ./ci-scripts/ci/publish-tfgen-package ${{ github.workspace }} - - if: failure() && github.event_name == 'push' - name: Notify Slack - uses: 8398a7/action-slack@v3 - with: - author_name: Failure in publishing SDK - fields: repo,commit,author,action - status: ${{ job.status }} - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - nodeversion: - - 16.x - pythonversion: - - "3.9" - - go_test_shim: - if: github.event_name == 'repository_dispatch' || - github.event.pull_request.head.repo.full_name == github.repository - name: Run test of provider shim - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: actions/setup-go@v4 - with: - go-version-file: 'provider/shim/go.mod' - cache-dependency-path: 'provider/shim/go.sum' - - name: go test - run: | - cd provider/shim - go test -v . - + SLACK_CHANNEL: provider-upgrade-publish-status + SLACK_COLOR: "#FF0000" + SLACK_ICON_EMOJI: ":taco:" + SLACK_MESSAGE: "Publish failed :x:" + SLACK_TITLE: ${{ github.event.repository.name }} upgrade result + SLACK_USERNAME: provider-bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: failure() + name: Send Publish Failure To Slack + uses: rtCamp/action-slack-notify@v2 test: name: test needs: build_sdk @@ -555,9 +354,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -569,7 +368,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v2 with: - node-version: ${{matrix.nodeversion}} + node-version: ${{ env.NODEVERSION }} registry-url: https://registry.npmjs.org - name: Setup DotNet uses: actions/setup-dotnet@v1 @@ -578,17 +377,16 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: ${{matrix.pythonversion}} + python-version: ${{ env.PYTHONVERSION }} - name: Setup Java uses: actions/setup-java@v3 with: cache: gradle distribution: temurin - java-version: ${{matrix.javaversion}} + java-version: ${{ env.JAVAVERSION }} - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: - # Pin to known good version until #2262 is resolved gradle-version: "7.6" - name: Download provider + tfgen binaries uses: actions/download-artifact@v2 @@ -611,11 +409,18 @@ jobs: run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} - name: Update path - run: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps run: |- pip3 install virtualenv==20.0.23 pip3 install pipenv + - name: Install dependencies + run: make install_${{ matrix.language}}_sdk + - name: Install gotestfmt + uses: GoTestTools/gotestfmt-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: v2.4.0 - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: @@ -625,13 +430,6 @@ jobs: role-duration-seconds: 3600 role-session-name: ${{ env.PROVIDER }}@githubActions role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.4.0 - 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 @@ -643,22 +441,34 @@ jobs: fields: repo,commit,author,action status: ${{ job.status }} strategy: - fail-fast: true + fail-fast: false matrix: - goversion: - - 1.20.x - javaversion: - - "11" language: - nodejs - python - dotnet - go - java - nodeversion: - - 16.x - pythonversion: - - "3.9" + go_test_shim: + if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository + name: Run test of provider shim + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + ref: ${{ env.PR_COMMIT_SHA }} + submodules: true + - uses: actions/setup-go@v4 + with: + cache-dependency-path: provider/shim/go.sum + go-version-file: provider/shim/go.mod + - name: go test + run: | + cd provider/shim + go test -v . + timeout-minutes: 60 + name: master on: push: @@ -670,4 +480,3 @@ on: - v* - sdk/* - "**" - workflow_dispatch: {} diff --git a/.github/workflows/nightly-test.yml b/.github/workflows/nightly-test.yml index 94cb58f6f4c..4156cf46542 100644 --- a/.github/workflows/nightly-test.yml +++ b/.github/workflows/nightly-test.yml @@ -1,13 +1,18 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + env: + PROVIDER: aws AWS_REGION: us-west-2 DOTNETVERSION: | - 6.0.x - 3.1.301 + 6.0.x + 3.1.301 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GOVERSION: 1.20.1 + JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODEVERSION: 16.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} - PROVIDER: aws PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} PUBLISH_REPO_USERNAME: ${{ secrets.OSSRH_USERNAME }} PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} @@ -16,10 +21,12 @@ env: PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget PULUMI_MISSING_DOCS_ERROR: true PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + PYTHONVERSION: "3.9" SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }} SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }} SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + TF_APPEND_USER_AGENT: pulumi TRAVIS_OS_NAME: linux jobs: build_sdk: @@ -41,9 +48,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -55,7 +62,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v2 with: - node-version: ${{matrix.nodeversion}} + node-version: ${{ env.NODEVERSION }} registry-url: https://registry.npmjs.org - name: Setup DotNet uses: actions/setup-dotnet@v1 @@ -64,17 +71,16 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: ${{matrix.pythonversion}} + python-version: ${{ env.PYTHONVERSION }} - name: Setup Java uses: actions/setup-java@v3 with: cache: gradle distribution: temurin - java-version: ${{matrix.javaversion}} + java-version: ${{ env.JAVAVERSION }} - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: - # Pin to known good version until #2262 is resolved gradle-version: "7.6" - name: Download provider + tfgen binaries uses: actions/download-artifact@v2 @@ -90,10 +96,10 @@ jobs: - name: Install plugins run: make install_plugins - name: Update path - run: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Set PACKAGE_VERSION to Env run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >> - $GITHUB_ENV + "$GITHUB_ENV" - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean @@ -116,20 +122,12 @@ jobs: strategy: fail-fast: true matrix: - goversion: - - 1.20.x - javaversion: - - "11" language: - nodejs - python - dotnet - go - java - nodeversion: - - 16.x - pythonversion: - - "3.9" prerequisites: name: prerequisites runs-on: ubuntu-latest @@ -148,9 +146,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -163,37 +161,33 @@ jobs: name: Install Schema Tools uses: jaxxstorm/action-install-gh-release@v1.5.0 with: - repo: mikhailshilkov/schema-tools - - name: Clear GitHub Actions Ubuntu runner disk space - uses: jlumbroso/free-disk-space@main - with: - tool-cache: false - dotnet: false - android: true - haskell: true - swap-storage: true - # TODO: enable once transient error with azure is resolved - # E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/universe/d/dotnet7/aspnetcore-targeting-pack-7.0_7.0.105-0ubuntu1%7e22.04.1_amd64.deb 404 Not Found [IP: 40.81.13.82 80] - large-packages: false + repo: pulumi/schema-tools - name: Build tfgen & provider binaries run: make provider - if: github.event_name == 'pull_request' name: Check Schema is Valid - run: >- - echo 'SCHEMA_CHANGES<> $GITHUB_ENV - - schema-tools compare ${{ env.PROVIDER }} master --local-path=provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> $GITHUB_ENV - - echo 'EOF' >> $GITHUB_ENV - - if: github.event_name == 'pull_request' + run: | + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + { + echo "SCHEMA_CHANGES<<$EOF"; + schema-tools compare -p ${{ env.PROVIDER }} -o ${{ github.event.repository.default_branch }} -n --local-path=provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json; + echo "$EOF"; + } >> "$GITHUB_ENV" + - if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' name: Comment on PR with Details of Schema Check - uses: thollander/actions-comment-pull-request@v1 + uses: thollander/actions-comment-pull-request@v2 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - message: | + comment_tag: schemaCheck + message: >+ ### Does the PR have any schema changes? + ${{ env.SCHEMA_CHANGES }} + + + Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. + - name: Tar provider binaries run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }} @@ -211,38 +205,6 @@ jobs: author_name: Failure in building provider prerequisites fields: repo,commit,author,action status: ${{ job.status }} - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - nodeversion: - - 16.x - pythonversion: - - "3.9" - - - go_test_shim: - if: github.event_name == 'repository_dispatch' || - github.event.pull_request.head.repo.full_name == github.repository - name: Run test of provider shim - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: actions/setup-go@v4 - with: - go-version-file: 'provider/shim/go.mod' - cache-dependency-path: 'provider/shim/go.sum' - - name: go test - run: | - cd provider/shim - go test -v . - test: name: test needs: build_sdk @@ -265,9 +227,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -279,7 +241,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v2 with: - node-version: ${{matrix.nodeversion}} + node-version: ${{ env.NODEVERSION }} registry-url: https://registry.npmjs.org - name: Setup DotNet uses: actions/setup-dotnet@v1 @@ -288,17 +250,16 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: ${{matrix.pythonversion}} + python-version: ${{ env.PYTHONVERSION }} - name: Setup Java uses: actions/setup-java@v3 with: cache: gradle distribution: temurin - java-version: ${{matrix.javaversion}} + java-version: ${{ env.JAVAVERSION }} - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: - # Pin to known good version until #2262 is resolved gradle-version: "7.6" - name: Download provider + tfgen binaries uses: actions/download-artifact@v2 @@ -321,11 +282,18 @@ jobs: run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} - name: Update path - run: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps run: |- pip3 install virtualenv==20.0.23 pip3 install pipenv + - name: Install dependencies + run: make install_${{ matrix.language}}_sdk + - name: Install gotestfmt + uses: GoTestTools/gotestfmt-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: v2.4.0 - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: @@ -335,13 +303,6 @@ jobs: role-duration-seconds: 3600 role-session-name: ${{ env.PROVIDER }}@githubActions role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.4.0 - 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 @@ -353,22 +314,14 @@ jobs: fields: repo,commit,author,action status: ${{ job.status }} strategy: - fail-fast: true + fail-fast: false matrix: - goversion: - - 1.20.x - javaversion: - - "11" language: - nodejs - python - dotnet - go - java - nodeversion: - - 16.x - pythonversion: - - "3.9" name: cron on: schedule: diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 3cf7336955e..2dc5141dd20 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -1,13 +1,19 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + env: + PROVIDER: aws + IS_PRERELEASE: true AWS_REGION: us-west-2 DOTNETVERSION: | - 6.0.x - 3.1.301 + 6.0.x + 3.1.301 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GOVERSION: 1.20.1 + JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODEVERSION: 16.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} - PROVIDER: aws PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} PUBLISH_REPO_USERNAME: ${{ secrets.OSSRH_USERNAME }} PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} @@ -16,10 +22,12 @@ env: PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget PULUMI_MISSING_DOCS_ERROR: true PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + PYTHONVERSION: "3.9" SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }} SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }} SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + TF_APPEND_USER_AGENT: pulumi TRAVIS_OS_NAME: linux jobs: build_sdk: @@ -41,9 +49,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -55,7 +63,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v2 with: - node-version: ${{matrix.nodeversion}} + node-version: ${{ env.NODEVERSION }} registry-url: https://registry.npmjs.org - name: Setup DotNet uses: actions/setup-dotnet@v1 @@ -64,17 +72,16 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: ${{matrix.pythonversion}} + python-version: ${{ env.PYTHONVERSION }} - name: Setup Java uses: actions/setup-java@v3 with: cache: gradle distribution: temurin - java-version: ${{matrix.javaversion}} + java-version: ${{ env.JAVAVERSION }} - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: - # Pin to known good version until #2262 is resolved gradle-version: "7.6" - name: Download provider + tfgen binaries uses: actions/download-artifact@v2 @@ -90,10 +97,10 @@ jobs: - name: Install plugins run: make install_plugins - name: Update path - run: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Set PACKAGE_VERSION to Env run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >> - $GITHUB_ENV + "$GITHUB_ENV" - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean @@ -115,20 +122,12 @@ jobs: strategy: fail-fast: true matrix: - goversion: - - 1.20.x - javaversion: - - "11" language: - nodejs - python - dotnet - go - java - nodeversion: - - 16.x - pythonversion: - - "3.9" prerequisites: name: prerequisites runs-on: ubuntu-latest @@ -147,14 +146,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: ${{matrix.nodeversion}} - registry-url: https://registry.npmjs.org + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -167,37 +161,42 @@ jobs: name: Install Schema Tools uses: jaxxstorm/action-install-gh-release@v1.5.0 with: - repo: mikhailshilkov/schema-tools + repo: pulumi/schema-tools - name: Clear GitHub Actions Ubuntu runner disk space uses: jlumbroso/free-disk-space@main with: - tool-cache: false - dotnet: false android: true + dotnet: false haskell: true - swap-storage: true - # TODO: enable once transient error with azure is resolved - # E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/universe/d/dotnet7/aspnetcore-targeting-pack-7.0_7.0.105-0ubuntu1%7e22.04.1_amd64.deb 404 Not Found [IP: 40.81.13.82 80] large-packages: false + swap-storage: true + tool-cache: false - name: Build tfgen & provider binaries run: make provider - if: github.event_name == 'pull_request' name: Check Schema is Valid - run: >- - echo 'SCHEMA_CHANGES<> $GITHUB_ENV - - schema-tools compare ${{ env.PROVIDER }} master --local-path=provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> $GITHUB_ENV - - echo 'EOF' >> $GITHUB_ENV - - if: github.event_name == 'pull_request' + run: | + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + { + echo "SCHEMA_CHANGES<<$EOF"; + schema-tools compare -p ${{ env.PROVIDER }} -o ${{ github.event.repository.default_branch }} -n --local-path=provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json; + echo "$EOF"; + } >> "$GITHUB_ENV" + - if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' name: Comment on PR with Details of Schema Check - uses: thollander/actions-comment-pull-request@v1 + uses: thollander/actions-comment-pull-request@v2 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - message: | + comment_tag: schemaCheck + message: >+ ### Does the PR have any schema changes? + ${{ env.SCHEMA_CHANGES }} + + + Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. + - name: Tar provider binaries run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }} @@ -214,18 +213,11 @@ jobs: author_name: Failure in building provider prerequisites fields: repo,commit,author,action status: ${{ job.status }} - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - nodeversion: - - 16.x - pythonversion: - - "3.9" publish: name: publish - needs: test + needs: + - test + - go_test_shim runs-on: pulumi-ubuntu-8core steps: - name: Checkout Repo @@ -237,9 +229,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -259,8 +251,7 @@ jobs: role-session-name: ${{ env.PROVIDER }}@githubActions role-to-assume: ${{ secrets.AWS_UPLOAD_ROLE_ARN }} - name: Set PreRelease Version - run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" - >> $GITHUB_ENV + run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> "$GITHUB_ENV" - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: @@ -274,191 +265,24 @@ jobs: author_name: Failure in publishing binaries fields: repo,commit,author,action status: ${{ job.status }} - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - nodeversion: - - 16.x - pythonversion: - - "3.9" - publish_java_sdk: - continue-on-error: true - name: publish_java_sdk - needs: publish - runs-on: pulumi-ubuntu-8core - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - submodules: true - - name: Checkout Scripts Repo - uses: actions/checkout@v3 - with: - path: ci-scripts - repository: pulumi/scripts - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: ${{matrix.goversion}} - cache-dependency-path: | - sdk/go.sum - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.5.0 - with: - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/actions@v4 - with: - pulumi-version: v3.77.1 - - name: Setup Java - uses: actions/setup-java@v3 - with: - cache: gradle - distribution: temurin - java-version: ${{matrix.javaversion}} - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - with: - # Pin to known good version until #2262 is resolved - gradle-version: "7.6" - - name: Download java SDK - uses: actions/download-artifact@v2 - with: - name: java-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress java SDK - run: tar -zxf ${{github.workspace}}/sdk/java.tar.gz -C - ${{github.workspace}}/sdk/java - - name: Set PACKAGE_VERSION to Env - run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >> - $GITHUB_ENV - - name: Publish Java SDK - uses: gradle/gradle-build-action@9b814496b50909128c6a52622b416c5ffa04db49 - with: - arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository - build-root-directory: ./sdk/java - gradle-version: 7.4.1 - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - javaversion: - - "11" publish_sdk: name: publish_sdk needs: publish runs-on: ubuntu-latest steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - submodules: true - - name: Checkout Scripts Repo - uses: actions/checkout@v3 - with: - path: ci-scripts - repository: pulumi/scripts - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: ${{matrix.goversion}} - cache-dependency-path: | - sdk/go.sum - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.5.0 - with: - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/actions@v4 - with: - pulumi-version: v3.77.1 - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: ${{matrix.nodeversion}} - registry-url: https://registry.npmjs.org - - name: Setup DotNet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ env.DOTNETVERSION }} - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{matrix.pythonversion}} - - name: Download python SDK - uses: actions/download-artifact@v2 - with: - name: python-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress python SDK - run: tar -zxf ${{github.workspace}}/sdk/python.tar.gz -C - ${{github.workspace}}/sdk/python - - name: Download dotnet SDK - uses: actions/download-artifact@v2 - with: - name: dotnet-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress dotnet SDK - run: tar -zxf ${{github.workspace}}/sdk/dotnet.tar.gz -C - ${{github.workspace}}/sdk/dotnet - - name: Download nodejs SDK - uses: actions/download-artifact@v2 - with: - name: nodejs-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress nodejs SDK - run: tar -zxf ${{github.workspace}}/sdk/nodejs.tar.gz -C - ${{github.workspace}}/sdk/nodejs - - run: python -m pip install pip twine + - name: Publish SDKs + uses: pulumi/pulumi-package-publisher@v0.0.9 - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish SDKs - run: ./ci-scripts/ci/publish-tfgen-package ${{ github.workspace }} - - if: failure() && github.event_name == 'push' - name: Notify Slack - uses: 8398a7/action-slack@v3 - with: - author_name: Failure in publishing SDK - fields: repo,commit,author,action - status: ${{ job.status }} - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - nodeversion: - - 16.x - pythonversion: - - "3.9" - - go_test_shim: - if: github.event_name == 'repository_dispatch' || - github.event.pull_request.head.repo.full_name == github.repository - name: Run test of provider shim - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: actions/setup-go@v4 - with: - go-version-file: 'provider/shim/go.mod' - cache-dependency-path: 'provider/shim/go.sum' - - name: go test - run: | - cd provider/shim - go test -v . - + SLACK_CHANNEL: provider-upgrade-publish-status + SLACK_COLOR: "#FF0000" + SLACK_ICON_EMOJI: ":taco:" + SLACK_MESSAGE: "Publish failed :x:" + SLACK_TITLE: ${{ github.event.repository.name }} upgrade result + SLACK_USERNAME: provider-bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: failure() + name: Send Publish Failure To Slack + uses: rtCamp/action-slack-notify@v2 test: name: test needs: build_sdk @@ -481,9 +305,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -495,7 +319,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v2 with: - node-version: ${{matrix.nodeversion}} + node-version: ${{ env.NODEVERSION }} registry-url: https://registry.npmjs.org - name: Setup DotNet uses: actions/setup-dotnet@v1 @@ -504,17 +328,16 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: ${{matrix.pythonversion}} + python-version: ${{ env.PYTHONVERSION }} - name: Setup Java uses: actions/setup-java@v3 with: cache: gradle distribution: temurin - java-version: ${{matrix.javaversion}} + java-version: ${{ env.JAVAVERSION }} - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: - # Pin to known good version until #2262 is resolved gradle-version: "7.6" - name: Download provider + tfgen binaries uses: actions/download-artifact@v2 @@ -537,11 +360,18 @@ jobs: run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} - name: Update path - run: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps run: |- pip3 install virtualenv==20.0.23 pip3 install pipenv + - name: Install dependencies + run: make install_${{ matrix.language}}_sdk + - name: Install gotestfmt + uses: GoTestTools/gotestfmt-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: v2.4.0 - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: @@ -551,13 +381,6 @@ jobs: role-duration-seconds: 3600 role-session-name: ${{ env.PROVIDER }}@githubActions role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.4.0 - 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 @@ -569,22 +392,34 @@ jobs: fields: repo,commit,author,action status: ${{ job.status }} strategy: - fail-fast: true + fail-fast: false matrix: - goversion: - - 1.20.x - javaversion: - - "11" language: - nodejs - python - dotnet - go - java - nodeversion: - - 16.x - pythonversion: - - "3.9" + go_test_shim: + if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository + name: Run test of provider shim + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + ref: ${{ env.PR_COMMIT_SHA }} + submodules: true + - uses: actions/setup-go@v4 + with: + cache-dependency-path: provider/shim/go.sum + go-version-file: provider/shim/go.mod + - name: go test + run: | + cd provider/shim + go test -v . + timeout-minutes: 60 + name: prerelease on: push: diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 93a5dbe7a24..ba074440893 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,13 +1,18 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + env: + PROVIDER: aws AWS_REGION: us-west-2 DOTNETVERSION: | - 6.0.x - 3.1.301 + 6.0.x + 3.1.301 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GOVERSION: 1.20.1 + JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODEVERSION: 16.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} - PROVIDER: aws PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} PUBLISH_REPO_USERNAME: ${{ secrets.OSSRH_USERNAME }} PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} @@ -16,10 +21,12 @@ env: PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget PULUMI_MISSING_DOCS_ERROR: true PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + PYTHONVERSION: "3.9" SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }} SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }} SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + TF_APPEND_USER_AGENT: pulumi TRAVIS_OS_NAME: linux jobs: comment-on-pr: @@ -29,8 +36,10 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v3 + with: + submodules: true - name: Comment PR - uses: thollander/actions-comment-pull-request@v1 + uses: thollander/actions-comment-pull-request@v2 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} message: > diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4972a6f8adf..10b134eea9a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,13 +1,18 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + env: + PROVIDER: aws AWS_REGION: us-west-2 DOTNETVERSION: | - 6.0.x - 3.1.301 + 6.0.x + 3.1.301 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GOVERSION: 1.20.1 + JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODEVERSION: 16.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} - PROVIDER: aws PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} PUBLISH_REPO_USERNAME: ${{ secrets.OSSRH_USERNAME }} PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} @@ -16,10 +21,12 @@ env: PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget PULUMI_MISSING_DOCS_ERROR: true PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + PYTHONVERSION: "3.9" SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }} SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }} SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + TF_APPEND_USER_AGENT: pulumi TRAVIS_OS_NAME: linux jobs: build_sdk: @@ -41,9 +48,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -55,7 +62,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v2 with: - node-version: ${{matrix.nodeversion}} + node-version: ${{ env.NODEVERSION }} registry-url: https://registry.npmjs.org - name: Setup DotNet uses: actions/setup-dotnet@v1 @@ -64,17 +71,16 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: ${{matrix.pythonversion}} + python-version: ${{ env.PYTHONVERSION }} - name: Setup Java uses: actions/setup-java@v3 with: cache: gradle distribution: temurin - java-version: ${{matrix.javaversion}} + java-version: ${{ env.JAVAVERSION }} - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: - # Pin to known good version until #2262 is resolved gradle-version: "7.6" - name: Download provider + tfgen binaries uses: actions/download-artifact@v2 @@ -90,10 +96,10 @@ jobs: - name: Install plugins run: make install_plugins - name: Update path - run: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Set PACKAGE_VERSION to Env run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >> - $GITHUB_ENV + "$GITHUB_ENV" - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean @@ -115,20 +121,12 @@ jobs: strategy: fail-fast: true matrix: - goversion: - - 1.20.x - javaversion: - - "11" language: - nodejs - python - dotnet - go - java - nodeversion: - - 16.x - pythonversion: - - "3.9" create_docs_build: name: create_docs_build needs: tag_sdk @@ -142,7 +140,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} name: Dispatch Event run: pulumictl create docs-build pulumi-${{ env.PROVIDER }} - ${GITHUB_REF#refs/tags/} + "${GITHUB_REF#refs/tags/}" prerequisites: name: prerequisites runs-on: ubuntu-latest @@ -161,18 +159,13 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: repo: pulumi/pulumictl - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: ${{matrix.nodeversion}} - registry-url: https://registry.npmjs.org - name: Install Pulumi CLI uses: pulumi/actions@v4 with: @@ -181,37 +174,33 @@ jobs: name: Install Schema Tools uses: jaxxstorm/action-install-gh-release@v1.5.0 with: - repo: mikhailshilkov/schema-tools - - name: Clear GitHub Actions Ubuntu runner disk space - uses: jlumbroso/free-disk-space@main - with: - tool-cache: false - dotnet: false - android: true - haskell: true - swap-storage: true - # TODO: enable once transient error with azure is resolved - # E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/universe/d/dotnet7/aspnetcore-targeting-pack-7.0_7.0.105-0ubuntu1%7e22.04.1_amd64.deb 404 Not Found [IP: 40.81.13.82 80] - large-packages: false + repo: pulumi/schema-tools - name: Build tfgen & provider binaries run: make provider - if: github.event_name == 'pull_request' name: Check Schema is Valid - run: >- - echo 'SCHEMA_CHANGES<> $GITHUB_ENV - - schema-tools compare ${{ env.PROVIDER }} master --local-path=provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> $GITHUB_ENV - - echo 'EOF' >> $GITHUB_ENV - - if: github.event_name == 'pull_request' + run: | + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + { + echo "SCHEMA_CHANGES<<$EOF"; + schema-tools compare -p ${{ env.PROVIDER }} -o ${{ github.event.repository.default_branch }} -n --local-path=provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json; + echo "$EOF"; + } >> "$GITHUB_ENV" + - if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' name: Comment on PR with Details of Schema Check - uses: thollander/actions-comment-pull-request@v1 + uses: thollander/actions-comment-pull-request@v2 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - message: | + comment_tag: schemaCheck + message: >+ ### Does the PR have any schema changes? + ${{ env.SCHEMA_CHANGES }} + + + Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. + - name: Tar provider binaries run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }} @@ -228,18 +217,11 @@ jobs: author_name: Failure in building provider prerequisites fields: repo,commit,author,action status: ${{ job.status }} - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - nodeversion: - - 16.x - pythonversion: - - "3.9" publish: name: publish - needs: test + needs: + - test + - go_test_shim runs-on: pulumi-ubuntu-8core steps: - name: Checkout Repo @@ -251,9 +233,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -273,8 +255,7 @@ jobs: role-session-name: ${{ env.PROVIDER }}@githubActions role-to-assume: ${{ secrets.AWS_UPLOAD_ROLE_ARN }} - name: Set PreRelease Version - run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" - >> $GITHUB_ENV + run: echo "GORELEASER_CURRENT_TAG=v$(pulumictl get version --language generic)" >> "$GITHUB_ENV" - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: @@ -287,169 +268,24 @@ jobs: author_name: Failure in publishing binaries fields: repo,commit,author,action status: ${{ job.status }} - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - nodeversion: - - 16.x - pythonversion: - - "3.9" - publish_java_sdk: - continue-on-error: true - name: publish_java_sdk - needs: publish - runs-on: pulumi-ubuntu-8core - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - submodules: true - - name: Checkout Scripts Repo - uses: actions/checkout@v3 - with: - path: ci-scripts - repository: pulumi/scripts - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: ${{matrix.goversion}} - cache-dependency-path: | - sdk/go.sum - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.5.0 - with: - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/actions@v4 - with: - pulumi-version: v3.77.1 - - name: Setup Java - uses: actions/setup-java@v3 - with: - cache: gradle - distribution: temurin - java-version: ${{matrix.javaversion}} - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - with: - # Pin to known good version until #2262 is resolved - gradle-version: "7.6" - - name: Download java SDK - uses: actions/download-artifact@v2 - with: - name: java-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress java SDK - run: tar -zxf ${{github.workspace}}/sdk/java.tar.gz -C - ${{github.workspace}}/sdk/java - - name: Set PACKAGE_VERSION to Env - run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >> - $GITHUB_ENV - - name: Publish Java SDK - uses: gradle/gradle-build-action@9b814496b50909128c6a52622b416c5ffa04db49 - with: - arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository - build-root-directory: ./sdk/java - gradle-version: 7.4.1 - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - javaversion: - - "11" publish_sdk: name: publish_sdk needs: publish runs-on: ubuntu-latest steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - submodules: true - - name: Checkout Scripts Repo - uses: actions/checkout@v3 - with: - path: ci-scripts - repository: pulumi/scripts - - name: Unshallow clone for tags - run: git fetch --prune --unshallow --tags - - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: ${{matrix.goversion}} - cache-dependency-path: | - sdk/go.sum - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.5.0 - with: - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/actions@v4 - with: - pulumi-version: v3.77.1 - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: ${{matrix.nodeversion}} - registry-url: https://registry.npmjs.org - - name: Setup DotNet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: ${{ env.DOTNETVERSION }} - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{matrix.pythonversion}} - - name: Download python SDK - uses: actions/download-artifact@v2 - with: - name: python-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress python SDK - run: tar -zxf ${{github.workspace}}/sdk/python.tar.gz -C - ${{github.workspace}}/sdk/python - - name: Download dotnet SDK - uses: actions/download-artifact@v2 - with: - name: dotnet-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress dotnet SDK - run: tar -zxf ${{github.workspace}}/sdk/dotnet.tar.gz -C - ${{github.workspace}}/sdk/dotnet - - name: Download nodejs SDK - uses: actions/download-artifact@v2 - with: - name: nodejs-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress nodejs SDK - run: tar -zxf ${{github.workspace}}/sdk/nodejs.tar.gz -C - ${{github.workspace}}/sdk/nodejs - - run: python -m pip install pip twine + - name: Publish SDKs + uses: pulumi/pulumi-package-publisher@v0.0.9 - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish SDKs - run: ./ci-scripts/ci/publish-tfgen-package ${{ github.workspace }} - - if: failure() && github.event_name == 'push' - name: Notify Slack - uses: 8398a7/action-slack@v3 - with: - author_name: Failure in publishing SDK - fields: repo,commit,author,action - status: ${{ job.status }} - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - nodeversion: - - 16.x - pythonversion: - - "3.9" + SLACK_CHANNEL: provider-upgrade-publish-status + SLACK_COLOR: "#FF0000" + SLACK_ICON_EMOJI: ":taco:" + SLACK_MESSAGE: "Publish failed :x:" + SLACK_TITLE: ${{ github.event.repository.name }} upgrade result + SLACK_USERNAME: provider-bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: failure() + name: Send Publish Failure To Slack + uses: rtCamp/action-slack-notify@v2 tag_sdk: name: tag_sdk needs: publish_sdk @@ -457,35 +293,15 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v3 + with: + submodules: true - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: repo: pulumi/pulumictl - name: Add SDK version tag - run: git tag sdk/v$(pulumictl get version --language generic) && git push origin - sdk/v$(pulumictl get version --language generic) - - go_test_shim: - if: github.event_name == 'repository_dispatch' || - github.event.pull_request.head.repo.full_name == github.repository - name: Run test of provider shim - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: actions/setup-go@v4 - with: - go-version-file: 'provider/shim/go.mod' - cache-dependency-path: 'provider/shim/go.sum' - - name: go test - run: | - cd provider/shim - go test -v . - + run: git tag "sdk/v$(pulumictl get version --language generic)" && git push origin + "sdk/v$(pulumictl get version --language generic)" test: name: test needs: build_sdk @@ -508,9 +324,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -522,7 +338,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v2 with: - node-version: ${{matrix.nodeversion}} + node-version: ${{ env.NODEVERSION }} registry-url: https://registry.npmjs.org - name: Setup DotNet uses: actions/setup-dotnet@v1 @@ -531,17 +347,16 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: ${{matrix.pythonversion}} + python-version: ${{ env.PYTHONVERSION }} - name: Setup Java uses: actions/setup-java@v3 with: cache: gradle distribution: temurin - java-version: ${{matrix.javaversion}} + java-version: ${{ env.JAVAVERSION }} - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: - # Pin to known good version until #2262 is resolved gradle-version: "7.6" - name: Download provider + tfgen binaries uses: actions/download-artifact@v2 @@ -564,11 +379,18 @@ jobs: run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} - name: Update path - run: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps run: |- pip3 install virtualenv==20.0.23 pip3 install pipenv + - name: Install dependencies + run: make install_${{ matrix.language}}_sdk + - name: Install gotestfmt + uses: GoTestTools/gotestfmt-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: v2.4.0 - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: @@ -578,13 +400,6 @@ jobs: role-duration-seconds: 3600 role-session-name: ${{ env.PROVIDER }}@githubActions role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.4.0 - 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 @@ -596,22 +411,34 @@ jobs: fields: repo,commit,author,action status: ${{ job.status }} strategy: - fail-fast: true + fail-fast: false matrix: - goversion: - - 1.20.x - javaversion: - - "11" language: - nodejs - python - dotnet - go - java - nodeversion: - - 16.x - pythonversion: - - "3.9" + go_test_shim: + if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository + name: Run test of provider shim + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + ref: ${{ env.PR_COMMIT_SHA }} + submodules: true + - uses: actions/setup-go@v4 + with: + cache-dependency-path: provider/shim/go.sum + go-version-file: provider/shim/go.mod + - name: go test + run: | + cd provider/shim + go test -v . + timeout-minutes: 60 + name: release on: push: diff --git a/.github/workflows/resync-build.yml b/.github/workflows/resync-build.yml new file mode 100644 index 00000000000..0aa65a5f753 --- /dev/null +++ b/.github/workflows/resync-build.yml @@ -0,0 +1,123 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + +env: + PROVIDER: aws + PULUMI_EXTRA_MAPPING_ERROR: true + PULUMI_MISSING_MAPPING_ERROR: true + AWS_REGION: us-west-2 + DOTNETVERSION: | + 6.0.x + 3.1.301 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GOVERSION: 1.20.1 + JAVAVERSION: "11" + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODEVERSION: 16.x + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} + PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + PUBLISH_REPO_USERNAME: ${{ secrets.OSSRH_USERNAME }} + PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} + PULUMI_API: https://api.pulumi-staging.io + PULUMI_GO_DEP_ROOT: ${{ github.workspace }}/.. + PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget + PULUMI_MISSING_DOCS_ERROR: true + PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + PYTHONVERSION: "3.9" + SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }} + SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }} + SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }} + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + TF_APPEND_USER_AGENT: pulumi + TRAVIS_OS_NAME: linux +jobs: + resync_build: + name: resync-build + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + submodules: true + - name: Checkout repo + uses: actions/checkout@v3 + with: + path: ci-mgmt + repository: pulumi/ci-mgmt + - 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: Unshallow clone for tags + run: git fetch --prune --unshallow --tags + - name: Install Go + uses: actions/setup-go@v4 + with: + cache-dependency-path: | + sdk/go.sum + go-version: 1.20.1 + - name: Install pulumictl + uses: jaxxstorm/action-install-gh-release@v1.5.0 + with: + repo: pulumi/pulumictl + - name: Install Pulumi CLI + uses: pulumi/actions@v4 + with: + pulumi-version: v3.77.1 + - name: Setup DotNet + uses: actions/setup-dotnet@v1 + with: + dotnet-version: ${{ env.DOTNETVERSION }} + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.NODEVERSION }} + registry-url: https://registry.npmjs.org + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: ${{ env.PYTHONVERSION }} + - name: Sync with ci-mgmt + run: cp -r "ci-mgmt/provider-ci/providers/$PROVIDER/repo/." . + - name: Remove ci-mgmt directory + run: rm -rf ci-mgmt + - name: Required entries for gitignore + run: |- + cat <<- EOF > "$RUNNER_TEMP/gitignore" + sdk/java/build + sdk/java/.gradle + sdk/java/gradle + sdk/java/gradlew + sdk/java/gradlew.bat + EOF + shell: bash + - name: Adding missing lines to .gitignore + run: | + comm -23 <(sort "$RUNNER_TEMP/gitignore") <(sort .gitignore) >> .gitignore.temp + cat .gitignore.temp >> .gitignore + rm .gitignore.temp + shell: bash + - name: Build + run: make build + - name: Create PR (no linked issue) + uses: peter-evans/create-pull-request@v3.12.0 + with: + author: pulumi-bot + base: master + body: This pull request was generated automatically by the resync-build workflow + in this repository. + branch: pulumi-bot/resync-${{ github.run_id}} + commit-message: Resync build for pulumi-${{ env.PROVIDER }} + committer: pulumi-bot + labels: impact/no-changelog-required + team-reviewers: platform-integrations + title: Fix up build for pulumi-${{ env.PROVIDER }} + token: ${{ secrets.PULUMI_BOT_TOKEN }} +name: Resync build +on: + workflow_dispatch: + inputs: + automerge: + default: false + description: Mark created PR for auto-merging? + required: true + type: boolean diff --git a/.github/workflows/run-acceptance-tests.yml b/.github/workflows/run-acceptance-tests.yml index d031c4c0d08..5c15ffdf186 100644 --- a/.github/workflows/run-acceptance-tests.yml +++ b/.github/workflows/run-acceptance-tests.yml @@ -1,14 +1,19 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + env: + PROVIDER: aws + PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} AWS_REGION: us-west-2 DOTNETVERSION: | - 6.0.x - 3.1.301 + 6.0.x + 3.1.301 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GOVERSION: 1.20.1 + JAVAVERSION: "11" NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODEVERSION: 16.x NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} - PROVIDER: aws - PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} PUBLISH_REPO_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} PUBLISH_REPO_USERNAME: ${{ secrets.OSSRH_USERNAME }} PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} @@ -17,10 +22,12 @@ env: PULUMI_LOCAL_NUGET: ${{ github.workspace }}/nuget PULUMI_MISSING_DOCS_ERROR: true PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + PYTHONVERSION: "3.9" SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }} SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }} SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + TF_APPEND_USER_AGENT: pulumi TRAVIS_OS_NAME: linux jobs: build_sdk: @@ -45,9 +52,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -59,7 +66,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v2 with: - node-version: ${{matrix.nodeversion}} + node-version: ${{ env.NODEVERSION }} registry-url: https://registry.npmjs.org - name: Setup DotNet uses: actions/setup-dotnet@v1 @@ -68,17 +75,16 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: ${{matrix.pythonversion}} + python-version: ${{ env.PYTHONVERSION }} - name: Setup Java uses: actions/setup-java@v3 with: cache: gradle distribution: temurin - java-version: ${{matrix.javaversion}} + java-version: ${{ env.JAVAVERSION }} - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: - # Pin to known good version until #2262 is resolved gradle-version: "7.6" - name: Download provider + tfgen binaries uses: actions/download-artifact@v2 @@ -94,10 +100,10 @@ jobs: - name: Install plugins run: make install_plugins - name: Update path - run: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Set PACKAGE_VERSION to Env run: echo "PACKAGE_VERSION=$(pulumictl get version --language generic)" >> - $GITHUB_ENV + "$GITHUB_ENV" - name: Build SDK run: make build_${{ matrix.language }} - name: Check worktree clean @@ -120,20 +126,12 @@ jobs: strategy: fail-fast: true matrix: - goversion: - - 1.20.x - javaversion: - - "11" language: - nodejs - python - dotnet - go - java - nodeversion: - - 16.x - pythonversion: - - "3.9" comment-notification: if: github.event_name == 'repository_dispatch' name: comment-notification @@ -141,8 +139,7 @@ jobs: steps: - id: run-url name: Create URL to the run output - run: echo ::set-output - name=run-url::https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID + 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: @@ -171,14 +168,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: ${{matrix.nodeversion}} - registry-url: https://registry.npmjs.org + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -195,14 +187,12 @@ jobs: - name: Clear GitHub Actions Ubuntu runner disk space uses: jlumbroso/free-disk-space@main with: - tool-cache: false - dotnet: false android: true + dotnet: false haskell: true - swap-storage: true - # TODO: enable once transient error with azure is resolved - # E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/universe/d/dotnet7/aspnetcore-targeting-pack-7.0_7.0.105-0ubuntu1%7e22.04.1_amd64.deb 404 Not Found [IP: 40.81.13.82 80] large-packages: false + swap-storage: true + tool-cache: false - name: Build tfgen & provider binaries run: make provider - if: github.event_name == 'pull_request' @@ -221,6 +211,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} comment_tag: schemaCheck message: >+ + ### Does the PR have any schema changes? + + ${{ env.SCHEMA_CHANGES }} @@ -243,47 +236,17 @@ jobs: author_name: Failure in building provider prerequisites fields: repo,commit,author,action status: ${{ job.status }} - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - nodeversion: - - 16.x - pythonversion: - - "3.9" sentinel: if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository name: sentinel needs: - test + - go_test_shim runs-on: ubuntu-latest steps: - name: Is workflow a success run: echo yes - - go_test_shim: - if: github.event_name == 'repository_dispatch' || - github.event.pull_request.head.repo.full_name == github.repository - name: Run test of provider shim - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: actions/setup-go@v4 - with: - go-version-file: 'provider/shim/go.mod' - cache-dependency-path: 'provider/shim/go.sum' - - name: go test - run: | - cd provider/shim - go test -v . - test: if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository @@ -309,9 +272,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -323,7 +286,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v2 with: - node-version: ${{matrix.nodeversion}} + node-version: ${{ env.NODEVERSION }} registry-url: https://registry.npmjs.org - name: Setup DotNet uses: actions/setup-dotnet@v1 @@ -332,17 +295,16 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: ${{matrix.pythonversion}} + python-version: ${{ env.PYTHONVERSION }} - name: Setup Java uses: actions/setup-java@v3 with: cache: gradle distribution: temurin - java-version: ${{matrix.javaversion}} + java-version: ${{ env.JAVAVERSION }} - name: Setup Gradle uses: gradle/gradle-build-action@v2 with: - # Pin to known good version until #2262 is resolved gradle-version: "7.6" - name: Download provider + tfgen binaries uses: actions/download-artifact@v2 @@ -365,11 +327,18 @@ jobs: run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} - name: Update path - run: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Install Python deps run: |- pip3 install virtualenv==20.0.23 pip3 install pipenv + - name: Install dependencies + run: make install_${{ matrix.language}}_sdk + - name: Install gotestfmt + uses: GoTestTools/gotestfmt-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: v2.4.0 - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v1 with: @@ -379,13 +348,6 @@ jobs: role-duration-seconds: 3600 role-session-name: ${{ env.PROVIDER }}@githubActions role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.4.0 - 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 @@ -397,29 +359,40 @@ jobs: fields: repo,commit,author,action status: ${{ job.status }} strategy: - fail-fast: true + fail-fast: false matrix: - goversion: - - 1.20.x - javaversion: - - "11" language: - nodejs - python - dotnet - go - java - nodeversion: - - 16.x - pythonversion: - - "3.9" + go_test_shim: + if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository + name: Run test of provider shim + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + ref: ${{ env.PR_COMMIT_SHA }} + submodules: true + - uses: actions/setup-go@v4 + with: + cache-dependency-path: provider/shim/go.sum + go-version-file: provider/shim/go.mod + - name: go test + run: | + cd provider/shim + go test -v . + timeout-minutes: 60 + name: run-acceptance-tests on: pull_request: branches: - master - main - - v6 paths-ignore: - CHANGELOG.md repository_dispatch: diff --git a/.github/workflows/update-bridge.yml b/.github/workflows/update-bridge.yml index 538f4df551c..0be09654118 100644 --- a/.github/workflows/update-bridge.yml +++ b/.github/workflows/update-bridge.yml @@ -1,7 +1,6 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + env: - DOTNETVERSION: | - 6.0.x - 3.1.301 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PULUMI_EXTRA_MAPPING_ERROR: false PULUMI_MISSING_MAPPING_ERROR: false @@ -19,9 +18,9 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: ${{matrix.goversion}} cache-dependency-path: | sdk/go.sum + go-version: 1.20.1 - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.5.0 with: @@ -37,12 +36,12 @@ jobs: - name: Setup Node uses: actions/setup-node@v2 with: - node-version: ${{matrix.nodeversion}} + node-version: ${{ env.NODEVERSION }} registry-url: https://registry.npmjs.org - name: Setup Python uses: actions/setup-python@v2 with: - python-version: ${{matrix.pythonversion}} + python-version: ${{ env.PYTHONVERSION }} - name: Update pulumi-terraform-bridge run: cd provider && go mod edit -require github.com/pulumi/pulumi-terraform-bridge/v3@v${{ @@ -56,14 +55,12 @@ jobs: - name: Clear GitHub Actions Ubuntu runner disk space uses: jlumbroso/free-disk-space@main with: - tool-cache: false - dotnet: false android: true + dotnet: false haskell: true - swap-storage: true - # TODO: enable once transient error with azure is resolved - # E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/universe/d/dotnet7/aspnetcore-targeting-pack-7.0_7.0.105-0ubuntu1%7e22.04.1_amd64.deb 404 Not Found [IP: 40.81.13.82 80] large-packages: false + swap-storage: true + tool-cache: false - run: make tfgen - run: make build_sdks - id: create-pr @@ -81,22 +78,20 @@ jobs: committer: pulumi-bot labels: impact/no-changelog-required team-reviewers: platform-integrations - title: Update pulumi-terraform-bridge to v${{ github.event.inputs.bridge_version - }} + title: Update pulumi-terraform-bridge to v${{ github.event.inputs.bridge_version }} token: ${{ secrets.PULUMI_BOT_TOKEN }} - strategy: - fail-fast: true - matrix: - goversion: - - 1.20.x - nodeversion: - - 16.x - pythonversion: - - "3.9" + - if: steps.create-pr.outputs.pull-request-operation == 'created' && + github.event.inputs.automerge == 'true' + run: gh pr merge --auto --squash ${{ steps.create-pr.outputs.pull-request-number }} name: Update pulumi-terraform-bridge on: workflow_dispatch: inputs: + automerge: + default: false + description: Mark created PR for auto-merging? + required: true + type: boolean bridge_version: description: The version of pulumi/pulumi-terraform-bridge to update to. Do not include the 'v' prefix. Must be major version 3. diff --git a/.github/workflows/upgrade-bridge.yml b/.github/workflows/upgrade-bridge.yml new file mode 100644 index 00000000000..84bfe8a11ec --- /dev/null +++ b/.github/workflows/upgrade-bridge.yml @@ -0,0 +1,41 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + +env: + GH_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +jobs: + upgrade_provider: + name: upgrade-provider + runs-on: ubuntu-latest + steps: + - name: Call upgrade provider action + uses: pulumi/pulumi-upgrade-provider-action@v0.0.5 + with: + kind: bridge + - env: + SLACK_CHANNEL: provider-upgrade-publish-status + SLACK_COLOR: "#7CFC00" + SLACK_ICON_EMOJI: ":taco:" + SLACK_MESSAGE: >- + Upgrade succeeded :heart_decoration: + + PR opened at github.com/pulumi/${{ github.event.repository.name }}/pulls + SLACK_TITLE: ${{ github.event.repository.name }} upgrade result + SLACK_USERNAME: provider-bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + name: Send Upgrade Success To Slack + uses: rtCamp/action-slack-notify@v2 + - env: + SLACK_CHANNEL: provider-upgrade-publish-status + SLACK_COLOR: "#FF0000" + SLACK_ICON_EMOJI: ":taco:" + SLACK_MESSAGE: " Upgrade failed :x:" + SLACK_TITLE: ${{ github.event.repository.name }} upgrade result + SLACK_USERNAME: provider-bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: failure() + name: Send Upgrade Failure To Slack + uses: rtCamp/action-slack-notify@v2 +name: Upgrade bridge +on: + workflow_dispatch: {} diff --git a/.github/workflows/upgrade-provider.yml b/.github/workflows/upgrade-provider.yml new file mode 100644 index 00000000000..e2ed3a3c016 --- /dev/null +++ b/.github/workflows/upgrade-provider.yml @@ -0,0 +1,45 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + +env: + GH_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +jobs: + upgrade_provider: + if: ${{ contains(github.event.issue.title, 'Upgrade terraform-provider-') }} + name: upgrade-provider + runs-on: ubuntu-latest + steps: + - name: Call upgrade provider action + uses: pulumi/pulumi-upgrade-provider-action@v0.0.5 + with: + kind: all + - env: + SLACK_CHANNEL: provider-upgrade-publish-status + SLACK_COLOR: "#7CFC00" + SLACK_ICON_EMOJI: ":taco:" + SLACK_MESSAGE: >- + Upgrade succeeded :heart_decoration: + + PR opened at github.com/pulumi/${{ github.event.repository.name }}/pulls + SLACK_TITLE: ${{ github.event.repository.name }} upgrade result + SLACK_USERNAME: provider-bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + name: Send Upgrade Success To Slack + uses: rtCamp/action-slack-notify@v2 + - env: + SLACK_CHANNEL: provider-upgrade-publish-status + SLACK_COLOR: "#FF0000" + SLACK_ICON_EMOJI: ":taco:" + SLACK_MESSAGE: " Upgrade failed :x:" + SLACK_TITLE: ${{ github.event.repository.name }} upgrade result + SLACK_USERNAME: provider-bot + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} + if: failure() + name: Send Upgrade Failure To Slack + uses: rtCamp/action-slack-notify@v2 +name: Upgrade provider +on: + issues: + types: + - opened + workflow_dispatch: {} diff --git a/.goreleaser.prerelease.yml b/.goreleaser.prerelease.yml index 4f33248b870..a83d15238ca 100644 --- a/.goreleaser.prerelease.yml +++ b/.goreleaser.prerelease.yml @@ -26,11 +26,14 @@ builds: - darwin - windows - linux + hooks: + post: + - env GOOS={{ .Os }} GOARCH={{ .Arch }} go clean -cache + - env GOOS={{ .Os }} GOARCH={{ .Arch }} go clean -modcache ignore: [] ldflags: - -X github.com/pulumi/pulumi-aws/provider/v6/pkg/version.Version={{.Tag}} - - -X - github.com/hashicorp/terraform-provider-aws/version.ProviderVersion={{.Tag}} + - -X github.com/hashicorp/terraform-provider-aws/version.ProviderVersion={{.Tag}} main: ./cmd/pulumi-resource-aws/ changelog: skip: true diff --git a/.goreleaser.yml b/.goreleaser.yml index c1468d224c2..128f21a23b3 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -26,6 +26,10 @@ builds: - darwin - windows - linux + hooks: + post: + - env GOOS={{ .Os }} GOARCH={{ .Arch }} go clean -cache + - env GOOS={{ .Os }} GOARCH={{ .Arch }} go clean -modcache ignore: [] ldflags: - -X github.com/pulumi/pulumi-aws/provider/v6/pkg/version.Version={{.Tag}} diff --git a/.upgrade-config.yml b/.upgrade-config.yml new file mode 100644 index 00000000000..a1d69a58915 --- /dev/null +++ b/.upgrade-config.yml @@ -0,0 +1,8 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + +--- +upstream-provider-name: terraform-provider-aws +pulumi-infer-version: true +remove-plugins: true +pr-reviewers: pulumi/Providers,lukehoban + diff --git a/scripts/upstream.sh b/scripts/upstream.sh new file mode 100644 index 00000000000..eddab76e9f1 --- /dev/null +++ b/scripts/upstream.sh @@ -0,0 +1,197 @@ +# +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + +set -e + +# "$1" is the current make command being run. +# It is used to make the error message more actionable. +err_rebase_in_progress() { + cat <