From f0e479d27545b63aab6d26490383cc60693843d6 Mon Sep 17 00:00:00 2001 From: Ian Wahbe Date: Tue, 22 Aug 2023 11:22:33 -0700 Subject: [PATCH] Generate files for aws --- provider-ci/providers/aws/config.yaml | 27 ++ .../.github/workflows/command-dispatch.yml | 51 +++ .../workflows/community-moderation.yml | 44 ++ .../aws/repo/.github/workflows/main.yml | 431 ++++++++++++++++++ .../aws/repo/.github/workflows/master.yml | 431 ++++++++++++++++++ .../repo/.github/workflows/nightly-test.yml | 307 +++++++++++++ .../aws/repo/.github/workflows/prerelease.yml | 371 +++++++++++++++ .../repo/.github/workflows/pull-request.yml | 49 ++ .../aws/repo/.github/workflows/release.yml | 398 ++++++++++++++++ .../repo/.github/workflows/resync-build.yml | 119 +++++ .../workflows/run-acceptance-tests.yml | 352 ++++++++++++++ .../repo/.github/workflows/update-bridge.yml | 91 ++++ .../repo/.github/workflows/upgrade-bridge.yml | 41 ++ .../.github/workflows/upgrade-provider.yml | 45 ++ provider-ci/providers/aws/repo/.golangci.yml | 26 ++ .../aws/repo/.goreleaser.prerelease.yml | 43 ++ .../providers/aws/repo/.goreleaser.yml | 52 +++ .../providers/aws/repo/.upgrade-config.yml | 8 + provider-ci/providers/aws/repo/Makefile | 131 ++++++ .../providers/aws/repo/scripts/upstream.sh | 197 ++++++++ 20 files changed, 3214 insertions(+) create mode 100644 provider-ci/providers/aws/config.yaml create mode 100644 provider-ci/providers/aws/repo/.github/workflows/command-dispatch.yml create mode 100644 provider-ci/providers/aws/repo/.github/workflows/community-moderation.yml create mode 100644 provider-ci/providers/aws/repo/.github/workflows/main.yml create mode 100644 provider-ci/providers/aws/repo/.github/workflows/master.yml create mode 100644 provider-ci/providers/aws/repo/.github/workflows/nightly-test.yml create mode 100644 provider-ci/providers/aws/repo/.github/workflows/prerelease.yml create mode 100644 provider-ci/providers/aws/repo/.github/workflows/pull-request.yml create mode 100644 provider-ci/providers/aws/repo/.github/workflows/release.yml create mode 100644 provider-ci/providers/aws/repo/.github/workflows/resync-build.yml create mode 100644 provider-ci/providers/aws/repo/.github/workflows/run-acceptance-tests.yml create mode 100644 provider-ci/providers/aws/repo/.github/workflows/update-bridge.yml create mode 100644 provider-ci/providers/aws/repo/.github/workflows/upgrade-bridge.yml create mode 100644 provider-ci/providers/aws/repo/.github/workflows/upgrade-provider.yml create mode 100644 provider-ci/providers/aws/repo/.golangci.yml create mode 100644 provider-ci/providers/aws/repo/.goreleaser.prerelease.yml create mode 100644 provider-ci/providers/aws/repo/.goreleaser.yml create mode 100644 provider-ci/providers/aws/repo/.upgrade-config.yml create mode 100644 provider-ci/providers/aws/repo/Makefile create mode 100644 provider-ci/providers/aws/repo/scripts/upstream.sh diff --git a/provider-ci/providers/aws/config.yaml b/provider-ci/providers/aws/config.yaml new file mode 100644 index 000000000..e091b7eb5 --- /dev/null +++ b/provider-ci/providers/aws/config.yaml @@ -0,0 +1,27 @@ +provider: aws +lint: false +major-version: 6 +parallel: 1 +timeout: 150 +generate-nightly-test-workflow: true +providerVersion: github.com/hashicorp/terraform-provider-aws/version.ProviderVersion +env: + PULUMI_MISSING_DOCS_ERROR: true + AWS_REGION: "us-west-2" +makeTemplate: bridged +plugins: + - name: archive + version: "0.0.1" + - name: tls + version: "4.10.0" + - name: github + version: "4.10.0" + - name: kubernetes + version: "3.17.0" + - name: random + version: "4.8.2" + - name: github + version: "5.14.0" +team: ecosystem +goBuildParallelism: 2 +javaGenVersion: "v0.9.5" diff --git a/provider-ci/providers/aws/repo/.github/workflows/command-dispatch.yml b/provider-ci/providers/aws/repo/.github/workflows/command-dispatch.yml new file mode 100644 index 000000000..75101ee80 --- /dev/null +++ b/provider-ci/providers/aws/repo/.github/workflows/command-dispatch.yml @@ -0,0 +1,51 @@ +# 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 }} + 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: + command-dispatch-for-testing: + name: command-dispatch-for-testing + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - uses: peter-evans/slash-command-dispatch@v2 + with: + commands: run-acceptance-tests + issue-type: pull-request + permission: write + reaction-token: ${{ secrets.GITHUB_TOKEN }} + repository: pulumi/pulumi-aws + token: ${{ secrets.PULUMI_BOT_TOKEN }} +name: command-dispatch +on: + issue_comment: + types: + - created + - edited diff --git a/provider-ci/providers/aws/repo/.github/workflows/community-moderation.yml b/provider-ci/providers/aws/repo/.github/workflows/community-moderation.yml new file mode 100644 index 000000000..647c712d3 --- /dev/null +++ b/provider-ci/providers/aws/repo/.github/workflows/community-moderation.yml @@ -0,0 +1,44 @@ +# 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: + warn_codegen: + name: warn_codegen + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - id: schema_changed + name: Check for diff in schema + uses: dorny/paths-filter@v2 + with: + filters: "changed: 'provider/cmd/**/schema.json'" + - id: sdk_changed + if: steps.schema_changed.outputs.changed == 'false' + name: Check for diff in sdk/** + uses: dorny/paths-filter@v2 + with: + filters: "changed: 'sdk/**'" + - 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@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + message: > + Hello and thank you for your pull request! :heart: :sparkles: + + It looks like you're directly modifying files in the language SDKs, many of which are autogenerated. + + Be sure any files you're editing do not begin with a code generation warning. + + For generated files, you will need to make changes in `resources.go` instead, and [generate the code](https://github.com/pulumi/${{ github.event.repository.name }}/blob/master/CONTRIBUTING.md#committing-generated-code). +name: warn-codegen +on: + pull_request_target: + branches: + - main + - master + types: + - opened diff --git a/provider-ci/providers/aws/repo/.github/workflows/main.yml b/provider-ci/providers/aws/repo/.github/workflows/main.yml new file mode 100644 index 000000000..00e9f1bc1 --- /dev/null +++ b/provider-ci/providers/aws/repo/.github/workflows/main.yml @@ -0,0 +1,431 @@ +# 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 }} + 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: + build_sdk: + name: build_sdk + needs: prerequisites + 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: + 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/action-install-pulumi-cli@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.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: ${{ env.PYTHONVERSION }} + - name: Setup Java + uses: actions/setup-java@v3 + with: + cache: gradle + distribution: temurin + java-version: ${{ env.JAVAVERSION }} + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + gradle-version: "7.6" + - name: Download provider + tfgen binaries + uses: actions/download-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin + - name: Untar provider binaries + run: >- + tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ + github.workspace}}/bin + + find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \; + - name: Install plugins + run: make install_plugins + - name: Update 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" + - name: Build SDK + run: make build_${{ matrix.language }} + - name: Check worktree clean + run: ./ci-scripts/ci/check-worktree-is-clean + - name: Compress SDK folder + run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.language }}-sdk.tar.gz + path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz + retention-days: 30 + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in building ${{ matrix.language }} sdk + fields: repo,commit,author,action + status: ${{ job.status }} + strategy: + fail-fast: true + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + generate_coverage_data: + continue-on-error: true + env: + COVERAGE_OUTPUT_DIR: ${{ secrets.COVERAGE_OUTPUT_DIR }} + name: generate_coverage_data + needs: prerequisites + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_CORP_S3_UPLOAD_ACCESS_KEY_ID }} + aws-region: us-west-2 + aws-secret-access-key: ${{ secrets.AWS_CORP_S3_UPLOAD_SECRET_ACCESS_KEY }} + - 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: + 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/action-install-pulumi-cli@v2 + - if: github.event_name == 'pull_request' + name: Install Schema Tools + uses: jaxxstorm/action-install-gh-release@v1.5.0 + with: + repo: pulumi/schema-tools + - name: Echo Coverage Output Dir + run: 'echo "Coverage output directory: ${{ env.COVERAGE_OUTPUT_DIR }}"' + - name: Generate Coverage Data + run: make tfgen + - name: Summarize Provider Coverage Results + 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" + + s3FullURI="s3://${{ secrets.S3_COVERAGE_BUCKET_NAME }}/summaries/${summaryName}" + + 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 + - 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: + 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/action-install-pulumi-cli@v2 + - if: github.event_name == 'pull_request' + name: Install Schema Tools + uses: jaxxstorm/action-install-gh-release@v1.5.0 + with: + repo: pulumi/schema-tools + - name: Build tfgen & provider binaries + run: make provider + - if: github.event_name == 'pull_request' + name: Check Schema is Valid + 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@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + 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 }} + pulumi-tfgen-${{ env.PROVIDER }} + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin/provider.tar.gz + retention-days: 30 + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in building provider prerequisites + fields: repo,commit,author,action + status: ${{ job.status }} + publish: + name: publish + needs: test + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - 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/action-install-pulumi-cli@v2 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-region: us-east-2 + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + role-duration-seconds: 7200 + role-external-id: upload-pulumi-release + 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" + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + args: -p 1 -f .goreleaser.prerelease.yml --rm-dist --skip-validate --timeout + 150m0s + version: latest + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in publishing binaries + fields: repo,commit,author,action + status: ${{ job.status }} + publish_sdk: + name: publish_sdk + needs: publish + runs-on: ubuntu-latest + steps: + - name: Publish SDKs + uses: pulumi/pulumi-package-publisher@v0.0.9 + - env: + 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 + permissions: + contents: read + id-token: write + 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: + 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/action-install-pulumi-cli@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.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: ${{ env.PYTHONVERSION }} + - name: Setup Java + uses: actions/setup-java@v3 + with: + cache: gradle + distribution: temurin + java-version: ${{ env.JAVAVERSION }} + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + gradle-version: "7.6" + - name: Download provider + tfgen binaries + uses: actions/download-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin + - name: Untar provider binaries + run: >- + tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ + github.workspace}}/bin + + find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \; + - run: dotnet nuget add source ${{ github.workspace }}/nuget + - name: Download SDK + uses: actions/download-artifact@v2 + with: + name: ${{ matrix.language }}-sdk.tar.gz + path: ${{ github.workspace}}/sdk/ + - name: Uncompress SDK folder + run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ + github.workspace }}/sdk/${{ matrix.language }} + - name: Update 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: 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 + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in running ${{ matrix.language }} tests + fields: repo,commit,author,action + status: ${{ job.status }} + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java +name: main +on: + push: + branches: + - main + paths-ignore: + - "**.md" + tags-ignore: + - v* + - sdk/* + - "**" diff --git a/provider-ci/providers/aws/repo/.github/workflows/master.yml b/provider-ci/providers/aws/repo/.github/workflows/master.yml new file mode 100644 index 000000000..56da0f10c --- /dev/null +++ b/provider-ci/providers/aws/repo/.github/workflows/master.yml @@ -0,0 +1,431 @@ +# 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 }} + 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: + build_sdk: + name: build_sdk + needs: prerequisites + 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: + 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/action-install-pulumi-cli@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.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: ${{ env.PYTHONVERSION }} + - name: Setup Java + uses: actions/setup-java@v3 + with: + cache: gradle + distribution: temurin + java-version: ${{ env.JAVAVERSION }} + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + gradle-version: "7.6" + - name: Download provider + tfgen binaries + uses: actions/download-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin + - name: Untar provider binaries + run: >- + tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ + github.workspace}}/bin + + find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \; + - name: Install plugins + run: make install_plugins + - name: Update 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" + - name: Build SDK + run: make build_${{ matrix.language }} + - name: Check worktree clean + run: ./ci-scripts/ci/check-worktree-is-clean + - name: Compress SDK folder + run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.language }}-sdk.tar.gz + path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz + retention-days: 30 + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in building ${{ matrix.language }} sdk + fields: repo,commit,author,action + status: ${{ job.status }} + strategy: + fail-fast: true + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + generate_coverage_data: + continue-on-error: true + env: + COVERAGE_OUTPUT_DIR: ${{ secrets.COVERAGE_OUTPUT_DIR }} + name: generate_coverage_data + needs: prerequisites + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_CORP_S3_UPLOAD_ACCESS_KEY_ID }} + aws-region: us-west-2 + aws-secret-access-key: ${{ secrets.AWS_CORP_S3_UPLOAD_SECRET_ACCESS_KEY }} + - 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: + 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/action-install-pulumi-cli@v2 + - if: github.event_name == 'pull_request' + name: Install Schema Tools + uses: jaxxstorm/action-install-gh-release@v1.5.0 + with: + repo: pulumi/schema-tools + - name: Echo Coverage Output Dir + run: 'echo "Coverage output directory: ${{ env.COVERAGE_OUTPUT_DIR }}"' + - name: Generate Coverage Data + run: make tfgen + - name: Summarize Provider Coverage Results + 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" + + s3FullURI="s3://${{ secrets.S3_COVERAGE_BUCKET_NAME }}/summaries/${summaryName}" + + 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 + - 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: + 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/action-install-pulumi-cli@v2 + - if: github.event_name == 'pull_request' + name: Install Schema Tools + uses: jaxxstorm/action-install-gh-release@v1.5.0 + with: + repo: pulumi/schema-tools + - name: Build tfgen & provider binaries + run: make provider + - if: github.event_name == 'pull_request' + name: Check Schema is Valid + 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@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + 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 }} + pulumi-tfgen-${{ env.PROVIDER }} + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin/provider.tar.gz + retention-days: 30 + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in building provider prerequisites + fields: repo,commit,author,action + status: ${{ job.status }} + publish: + name: publish + needs: test + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - 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/action-install-pulumi-cli@v2 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-region: us-east-2 + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + role-duration-seconds: 7200 + role-external-id: upload-pulumi-release + 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" + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + args: -p 1 -f .goreleaser.prerelease.yml --rm-dist --skip-validate --timeout + 150m0s + version: latest + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in publishing binaries + fields: repo,commit,author,action + status: ${{ job.status }} + publish_sdk: + name: publish_sdk + needs: publish + runs-on: ubuntu-latest + steps: + - name: Publish SDKs + uses: pulumi/pulumi-package-publisher@v0.0.9 + - env: + 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 + permissions: + contents: read + id-token: write + 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: + 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/action-install-pulumi-cli@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.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: ${{ env.PYTHONVERSION }} + - name: Setup Java + uses: actions/setup-java@v3 + with: + cache: gradle + distribution: temurin + java-version: ${{ env.JAVAVERSION }} + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + gradle-version: "7.6" + - name: Download provider + tfgen binaries + uses: actions/download-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin + - name: Untar provider binaries + run: >- + tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ + github.workspace}}/bin + + find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \; + - run: dotnet nuget add source ${{ github.workspace }}/nuget + - name: Download SDK + uses: actions/download-artifact@v2 + with: + name: ${{ matrix.language }}-sdk.tar.gz + path: ${{ github.workspace}}/sdk/ + - name: Uncompress SDK folder + run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ + github.workspace }}/sdk/${{ matrix.language }} + - name: Update 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: 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 + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in running ${{ matrix.language }} tests + fields: repo,commit,author,action + status: ${{ job.status }} + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java +name: master +on: + push: + branches: + - master + paths-ignore: + - "**.md" + tags-ignore: + - v* + - sdk/* + - "**" diff --git a/provider-ci/providers/aws/repo/.github/workflows/nightly-test.yml b/provider-ci/providers/aws/repo/.github/workflows/nightly-test.yml new file mode 100644 index 000000000..effd74998 --- /dev/null +++ b/provider-ci/providers/aws/repo/.github/workflows/nightly-test.yml @@ -0,0 +1,307 @@ +# 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 }} + 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: + build_sdk: + name: build_sdk + needs: prerequisites + 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: + 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/action-install-pulumi-cli@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.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: ${{ env.PYTHONVERSION }} + - name: Setup Java + uses: actions/setup-java@v3 + with: + cache: gradle + distribution: temurin + java-version: ${{ env.JAVAVERSION }} + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + gradle-version: "7.6" + - name: Download provider + tfgen binaries + uses: actions/download-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin + - name: Untar provider binaries + run: >- + tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ + github.workspace}}/bin + + find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \; + - name: Install plugins + run: make install_plugins + - name: Update 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" + - name: Build SDK + run: make build_${{ matrix.language }} + - name: Check worktree clean + run: ./ci-scripts/ci/check-worktree-is-clean + - name: Compress SDK folder + run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.language }}-sdk.tar.gz + path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz + retention-days: 30 + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in building ${{ matrix.language }} sdk + fields: repo,commit,author,action + status: ${{ job.status }} + strategy: + fail-fast: true + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + prerequisites: + name: prerequisites + 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: + 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/action-install-pulumi-cli@v2 + - if: github.event_name == 'pull_request' + name: Install Schema Tools + uses: jaxxstorm/action-install-gh-release@v1.5.0 + with: + repo: pulumi/schema-tools + - name: Build tfgen & provider binaries + run: make provider + - if: github.event_name == 'pull_request' + name: Check Schema is Valid + 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@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + 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 }} + pulumi-tfgen-${{ env.PROVIDER }} + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin/provider.tar.gz + retention-days: 30 + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in building provider prerequisites + fields: repo,commit,author,action + status: ${{ job.status }} + test: + name: test + needs: build_sdk + permissions: + contents: read + id-token: write + 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: + 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/action-install-pulumi-cli@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.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: ${{ env.PYTHONVERSION }} + - name: Setup Java + uses: actions/setup-java@v3 + with: + cache: gradle + distribution: temurin + java-version: ${{ env.JAVAVERSION }} + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + gradle-version: "7.6" + - name: Download provider + tfgen binaries + uses: actions/download-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin + - name: Untar provider binaries + run: >- + tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ + github.workspace}}/bin + + find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \; + - run: dotnet nuget add source ${{ github.workspace }}/nuget + - name: Download SDK + uses: actions/download-artifact@v2 + with: + name: ${{ matrix.language }}-sdk.tar.gz + path: ${{ github.workspace}}/sdk/ + - name: Uncompress SDK folder + run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ + github.workspace }}/sdk/${{ matrix.language }} + - name: Update 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: 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 + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in running ${{ matrix.language }} tests + fields: repo,commit,author,action + status: ${{ job.status }} + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java +name: cron +on: + schedule: + - cron: 0 6 * * * diff --git a/provider-ci/providers/aws/repo/.github/workflows/prerelease.yml b/provider-ci/providers/aws/repo/.github/workflows/prerelease.yml new file mode 100644 index 000000000..856a98951 --- /dev/null +++ b/provider-ci/providers/aws/repo/.github/workflows/prerelease.yml @@ -0,0 +1,371 @@ +# 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 + 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: + build_sdk: + name: build_sdk + needs: prerequisites + 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: + 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/action-install-pulumi-cli@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.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: ${{ env.PYTHONVERSION }} + - name: Setup Java + uses: actions/setup-java@v3 + with: + cache: gradle + distribution: temurin + java-version: ${{ env.JAVAVERSION }} + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + gradle-version: "7.6" + - name: Download provider + tfgen binaries + uses: actions/download-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin + - name: Untar provider binaries + run: >- + tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ + github.workspace}}/bin + + find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \; + - name: Install plugins + run: make install_plugins + - name: Update 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" + - name: Build SDK + run: make build_${{ matrix.language }} + - name: Check worktree clean + run: ./ci-scripts/ci/check-worktree-is-clean + - name: Compress SDK folder + run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.language }}-sdk.tar.gz + path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in building ${{ matrix.language }} sdk + fields: repo,commit,author,action + status: ${{ job.status }} + strategy: + fail-fast: true + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + prerequisites: + name: prerequisites + 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: + 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/action-install-pulumi-cli@v2 + - if: github.event_name == 'pull_request' + name: Install Schema Tools + uses: jaxxstorm/action-install-gh-release@v1.5.0 + with: + repo: pulumi/schema-tools + - name: Build tfgen & provider binaries + run: make provider + - if: github.event_name == 'pull_request' + name: Check Schema is Valid + 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@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + 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 }} + pulumi-tfgen-${{ env.PROVIDER }} + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin/provider.tar.gz + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in building provider prerequisites + fields: repo,commit,author,action + status: ${{ job.status }} + publish: + name: publish + needs: test + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - 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/action-install-pulumi-cli@v2 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-region: us-east-2 + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + role-duration-seconds: 7200 + role-external-id: upload-pulumi-release + 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" + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + args: -p 1 -f .goreleaser.prerelease.yml --rm-dist --skip-validate --timeout + 150m0s + version: latest + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in publishing binaries + fields: repo,commit,author,action + status: ${{ job.status }} + publish_sdk: + name: publish_sdk + needs: publish + runs-on: ubuntu-latest + steps: + - name: Publish SDKs + uses: pulumi/pulumi-package-publisher@v0.0.9 + - env: + 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 + permissions: + contents: read + id-token: write + 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: + 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/action-install-pulumi-cli@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.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: ${{ env.PYTHONVERSION }} + - name: Setup Java + uses: actions/setup-java@v3 + with: + cache: gradle + distribution: temurin + java-version: ${{ env.JAVAVERSION }} + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + gradle-version: "7.6" + - name: Download provider + tfgen binaries + uses: actions/download-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin + - name: Untar provider binaries + run: >- + tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ + github.workspace}}/bin + + find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \; + - run: dotnet nuget add source ${{ github.workspace }}/nuget + - name: Download SDK + uses: actions/download-artifact@v2 + with: + name: ${{ matrix.language }}-sdk.tar.gz + path: ${{ github.workspace}}/sdk/ + - name: Uncompress SDK folder + run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ + github.workspace }}/sdk/${{ matrix.language }} + - name: Update 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: 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 + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in running ${{ matrix.language }} tests + fields: repo,commit,author,action + status: ${{ job.status }} + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java +name: prerelease +on: + push: + tags: + - v*.*.*-** diff --git a/provider-ci/providers/aws/repo/.github/workflows/pull-request.yml b/provider-ci/providers/aws/repo/.github/workflows/pull-request.yml new file mode 100644 index 000000000..4bb6c81e7 --- /dev/null +++ b/provider-ci/providers/aws/repo/.github/workflows/pull-request.yml @@ -0,0 +1,49 @@ +# 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 }} + 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: + comment-on-pr: + if: github.event.pull_request.head.repo.full_name != github.repository + name: comment-on-pr + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Comment PR + uses: thollander/actions-comment-pull-request@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + message: > + PR is now waiting for a maintainer to run the acceptance tests. + + **Note for the maintainer:** To run the acceptance tests, please comment */run-acceptance-tests* on the PR +name: pull-request +on: + pull_request_target: {} diff --git a/provider-ci/providers/aws/repo/.github/workflows/release.yml b/provider-ci/providers/aws/repo/.github/workflows/release.yml new file mode 100644 index 000000000..d9a428ba1 --- /dev/null +++ b/provider-ci/providers/aws/repo/.github/workflows/release.yml @@ -0,0 +1,398 @@ +# 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 }} + 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: + build_sdk: + name: build_sdk + needs: prerequisites + 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: + 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/action-install-pulumi-cli@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.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: ${{ env.PYTHONVERSION }} + - name: Setup Java + uses: actions/setup-java@v3 + with: + cache: gradle + distribution: temurin + java-version: ${{ env.JAVAVERSION }} + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + gradle-version: "7.6" + - name: Download provider + tfgen binaries + uses: actions/download-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin + - name: Untar provider binaries + run: >- + tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ + github.workspace}}/bin + + find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \; + - name: Install plugins + run: make install_plugins + - name: Update 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" + - name: Build SDK + run: make build_${{ matrix.language }} + - name: Check worktree clean + run: ./ci-scripts/ci/check-worktree-is-clean + - name: Compress SDK folder + run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.language }}-sdk.tar.gz + path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in building ${{ matrix.language }} sdk + fields: repo,commit,author,action + status: ${{ job.status }} + strategy: + fail-fast: true + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + create_docs_build: + name: create_docs_build + needs: tag_sdk + runs-on: ubuntu-latest + steps: + - name: Install pulumictl + uses: jaxxstorm/action-install-gh-release@v1.5.0 + with: + repo: pulumi/pulumictl + - env: + GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} + name: Dispatch Event + run: pulumictl create docs-build pulumi-${{ env.PROVIDER }} + "${GITHUB_REF#refs/tags/}" + prerequisites: + name: prerequisites + 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: + 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/action-install-pulumi-cli@v2 + - if: github.event_name == 'pull_request' + name: Install Schema Tools + uses: jaxxstorm/action-install-gh-release@v1.5.0 + with: + repo: pulumi/schema-tools + - name: Build tfgen & provider binaries + run: make provider + - if: github.event_name == 'pull_request' + name: Check Schema is Valid + 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@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + 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 }} + pulumi-tfgen-${{ env.PROVIDER }} + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin/provider.tar.gz + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in building provider prerequisites + fields: repo,commit,author,action + status: ${{ job.status }} + publish: + name: publish + needs: test + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - 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/action-install-pulumi-cli@v2 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-region: us-east-2 + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + role-duration-seconds: 7200 + role-external-id: upload-pulumi-release + 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" + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + args: -p 1 release --rm-dist --timeout 150m0s + version: latest + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in publishing binaries + fields: repo,commit,author,action + status: ${{ job.status }} + publish_sdk: + name: publish_sdk + needs: publish + runs-on: ubuntu-latest + steps: + - name: Publish SDKs + uses: pulumi/pulumi-package-publisher@v0.0.9 + - env: + 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 + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - 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)" + test: + name: test + needs: build_sdk + permissions: + contents: read + id-token: write + 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: + 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/action-install-pulumi-cli@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.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: ${{ env.PYTHONVERSION }} + - name: Setup Java + uses: actions/setup-java@v3 + with: + cache: gradle + distribution: temurin + java-version: ${{ env.JAVAVERSION }} + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + gradle-version: "7.6" + - name: Download provider + tfgen binaries + uses: actions/download-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin + - name: Untar provider binaries + run: >- + tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ + github.workspace}}/bin + + find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \; + - run: dotnet nuget add source ${{ github.workspace }}/nuget + - name: Download SDK + uses: actions/download-artifact@v2 + with: + name: ${{ matrix.language }}-sdk.tar.gz + path: ${{ github.workspace}}/sdk/ + - name: Uncompress SDK folder + run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ + github.workspace }}/sdk/${{ matrix.language }} + - name: Update 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: 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 + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in running ${{ matrix.language }} tests + fields: repo,commit,author,action + status: ${{ job.status }} + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java +name: release +on: + push: + tags: + - v*.*.* + - "!v*.*.*-**" diff --git a/provider-ci/providers/aws/repo/.github/workflows/resync-build.yml b/provider-ci/providers/aws/repo/.github/workflows/resync-build.yml new file mode 100644 index 000000000..952c2efbf --- /dev/null +++ b/provider-ci/providers/aws/repo/.github/workflows/resync-build.yml @@ -0,0 +1,119 @@ +# 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 + - 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/action-install-pulumi-cli@v2 + - 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/provider-ci/providers/aws/repo/.github/workflows/run-acceptance-tests.yml b/provider-ci/providers/aws/repo/.github/workflows/run-acceptance-tests.yml new file mode 100644 index 000000000..1ed0f6c96 --- /dev/null +++ b/provider-ci/providers/aws/repo/.github/workflows/run-acceptance-tests.yml @@ -0,0 +1,352 @@ +# 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 + 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: + build_sdk: + if: github.event_name == 'repository_dispatch' || + github.event.pull_request.head.repo.full_name == github.repository + name: build_sdk + needs: prerequisites + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + ref: ${{ env.PR_COMMIT_SHA }} + - 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: + 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/action-install-pulumi-cli@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.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: ${{ env.PYTHONVERSION }} + - name: Setup Java + uses: actions/setup-java@v3 + with: + cache: gradle + distribution: temurin + java-version: ${{ env.JAVAVERSION }} + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + gradle-version: "7.6" + - name: Download provider + tfgen binaries + uses: actions/download-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin + - name: Untar provider binaries + run: >- + tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ + github.workspace}}/bin + + find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \; + - name: Install plugins + run: make install_plugins + - name: Update 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" + - name: Build SDK + run: make build_${{ matrix.language }} + - name: Check worktree clean + run: ./ci-scripts/ci/check-worktree-is-clean + - name: Compress SDK folder + run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.language }}-sdk.tar.gz + path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz + retention-days: 30 + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in building ${{ matrix.language }} sdk + fields: repo,commit,author,action + status: ${{ job.status }} + strategy: + fail-fast: true + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + comment-notification: + if: github.event_name == 'repository_dispatch' + name: comment-notification + runs-on: ubuntu-latest + steps: + - id: run-url + name: Create URL to the run output + run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> "$GITHUB_OUTPUT" + - name: Update with Result + uses: peter-evans/create-or-update-comment@v1 + with: + body: "Please view the PR build: ${{ steps.run-url.outputs.run-url }}" + issue-number: ${{ github.event.client_payload.github.payload.issue.number }} + repository: ${{ github.event.client_payload.github.payload.repository.full_name }} + token: ${{ secrets.PULUMI_BOT_TOKEN }} + prerequisites: + if: github.event_name == 'repository_dispatch' || + github.event.pull_request.head.repo.full_name == github.repository + name: prerequisites + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + ref: ${{ env.PR_COMMIT_SHA }} + - 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: + 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/action-install-pulumi-cli@v2 + - if: github.event_name == 'pull_request' + name: Install Schema Tools + uses: jaxxstorm/action-install-gh-release@v1.5.0 + with: + repo: pulumi/schema-tools + - name: Build tfgen & provider binaries + run: make provider + - if: github.event_name == 'pull_request' + name: Check Schema is Valid + 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@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + 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 }} + pulumi-tfgen-${{ env.PROVIDER }} + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin/provider.tar.gz + retention-days: 30 + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in building provider prerequisites + fields: repo,commit,author,action + status: ${{ job.status }} + sentinel: + if: github.event_name == 'repository_dispatch' || + github.event.pull_request.head.repo.full_name == github.repository + name: sentinel + needs: + - test + runs-on: ubuntu-latest + steps: + - name: Is workflow a success + run: echo yes + test: + if: github.event_name == 'repository_dispatch' || + github.event.pull_request.head.repo.full_name == github.repository + name: test + needs: build_sdk + permissions: + contents: read + id-token: write + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + ref: ${{ env.PR_COMMIT_SHA }} + - 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: + 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/action-install-pulumi-cli@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: ${{ env.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: ${{ env.PYTHONVERSION }} + - name: Setup Java + uses: actions/setup-java@v3 + with: + cache: gradle + distribution: temurin + java-version: ${{ env.JAVAVERSION }} + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + gradle-version: "7.6" + - name: Download provider + tfgen binaries + uses: actions/download-artifact@v2 + with: + name: ${{ env.PROVIDER }}-provider.tar.gz + path: ${{ github.workspace }}/bin + - name: Untar provider binaries + run: >- + tar -zxf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ + github.workspace}}/bin + + find ${{ github.workspace }} -name "pulumi-*-${{ env.PROVIDER }}" -print -exec chmod +x {} \; + - run: dotnet nuget add source ${{ github.workspace }}/nuget + - name: Download SDK + uses: actions/download-artifact@v2 + with: + name: ${{ matrix.language }}-sdk.tar.gz + path: ${{ github.workspace}}/sdk/ + - name: Uncompress SDK folder + run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ + github.workspace }}/sdk/${{ matrix.language }} + - name: Update 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: 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 + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in running ${{ matrix.language }} tests + fields: repo,commit,author,action + status: ${{ job.status }} + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java +name: run-acceptance-tests +on: + pull_request: + branches: + - master + - main + paths-ignore: + - CHANGELOG.md + repository_dispatch: + types: + - run-acceptance-tests-command diff --git a/provider-ci/providers/aws/repo/.github/workflows/update-bridge.yml b/provider-ci/providers/aws/repo/.github/workflows/update-bridge.yml new file mode 100644 index 000000000..c1fe242af --- /dev/null +++ b/provider-ci/providers/aws/repo/.github/workflows/update-bridge.yml @@ -0,0 +1,91 @@ +# 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 }} + PULUMI_EXTRA_MAPPING_ERROR: false + PULUMI_MISSING_MAPPING_ERROR: false +jobs: + update_bridge: + name: update-bridge + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - 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/action-install-pulumi-cli@v2 + - 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: Update pulumi-terraform-bridge + run: cd provider && go mod edit -require + github.com/pulumi/pulumi-terraform-bridge/v3@v${{ + github.event.inputs.bridge_version }} && go mod tidy + - name: Update Pulumi SDK (provider/go.mod) + run: cd provider && go mod edit -require github.com/pulumi/pulumi/sdk/v3@v${{ + github.event.inputs.sdk_version }} && go mod tidy + - name: Update Pulumi SDK (sdk/go.mod) + run: cd sdk && go mod edit -require github.com/pulumi/pulumi/sdk/v3@v${{ + github.event.inputs.sdk_version }} && go mod tidy + - run: make tfgen + - run: make build_sdks + - id: create-pr + name: Create PR + uses: peter-evans/create-pull-request@v3.12.0 + with: + author: pulumi-bot + base: master + body: This pull request was generated automatically by the update-bridge + workflow in this repository. + branch: pulumi-bot/bridge-v${{ github.event.inputs.bridge_version }}-${{ + github.run_id}} + commit-message: Update pulumi-terraform-bridge to v${{ + github.event.inputs.bridge_version }} + committer: pulumi-bot + labels: impact/no-changelog-required + team-reviewers: platform-integrations + title: Update pulumi-terraform-bridge to v${{ github.event.inputs.bridge_version }} + token: ${{ secrets.PULUMI_BOT_TOKEN }} + - 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. + required: true + type: string + sdk_version: + description: The version of pulumi/pulumi/sdk to update to. Do not include the + 'v' prefix. Must be major version 3. + required: true + type: string diff --git a/provider-ci/providers/aws/repo/.github/workflows/upgrade-bridge.yml b/provider-ci/providers/aws/repo/.github/workflows/upgrade-bridge.yml new file mode 100644 index 000000000..84bfe8a11 --- /dev/null +++ b/provider-ci/providers/aws/repo/.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/provider-ci/providers/aws/repo/.github/workflows/upgrade-provider.yml b/provider-ci/providers/aws/repo/.github/workflows/upgrade-provider.yml new file mode 100644 index 000000000..e2ed3a3c0 --- /dev/null +++ b/provider-ci/providers/aws/repo/.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/provider-ci/providers/aws/repo/.golangci.yml b/provider-ci/providers/aws/repo/.golangci.yml new file mode 100644 index 000000000..565aff5d1 --- /dev/null +++ b/provider-ci/providers/aws/repo/.golangci.yml @@ -0,0 +1,26 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + +linters: + enable: + - deadcode + - errcheck + - goconst + - gofmt + - golint + - gosec + - govet + - ineffassign + - interfacer + - lll + - megacheck + - misspell + - nakedret + - structcheck + - unconvert + - varcheck + enable-all: false +run: + skip-files: + - schema.go + - pulumiManifest.go + timeout: 20m diff --git a/provider-ci/providers/aws/repo/.goreleaser.prerelease.yml b/provider-ci/providers/aws/repo/.goreleaser.prerelease.yml new file mode 100644 index 000000000..a83d15238 --- /dev/null +++ b/provider-ci/providers/aws/repo/.goreleaser.prerelease.yml @@ -0,0 +1,43 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + +archives: +- id: archive + name_template: "{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}" +before: + hooks: + - make tfgen +blobs: +- bucket: get.pulumi.com + folder: releases/plugins/ + ids: + - archive + provider: s3 + region: us-west-2 +builds: +- binary: pulumi-resource-aws + dir: provider + env: + - CGO_ENABLED=0 + - GO111MODULE=on + goarch: + - amd64 + - arm64 + goos: + - 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}} + main: ./cmd/pulumi-resource-aws/ +changelog: + skip: true +release: + disable: true +snapshot: + name_template: "{{ .Tag }}-SNAPSHOT" diff --git a/provider-ci/providers/aws/repo/.goreleaser.yml b/provider-ci/providers/aws/repo/.goreleaser.yml new file mode 100644 index 000000000..128f21a23 --- /dev/null +++ b/provider-ci/providers/aws/repo/.goreleaser.yml @@ -0,0 +1,52 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + +archives: +- id: archive + name_template: "{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}" +before: + hooks: + - make tfgen +blobs: +- bucket: get.pulumi.com + folder: releases/plugins/ + ids: + - archive + provider: s3 + region: us-west-2 +builds: +- binary: pulumi-resource-aws + dir: provider + env: + - CGO_ENABLED=0 + - GO111MODULE=on + goarch: + - amd64 + - arm64 + goos: + - 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}} + main: ./cmd/pulumi-resource-aws/ +changelog: + filters: + exclude: + - Merge branch + - Merge pull request + - \Winternal\W + - \Wci\W + - \Wchore\W + sort: asc + use: git +release: + disable: false +snapshot: + name_template: "{{ .Tag }}-SNAPSHOT" diff --git a/provider-ci/providers/aws/repo/.upgrade-config.yml b/provider-ci/providers/aws/repo/.upgrade-config.yml new file mode 100644 index 000000000..a1d69a589 --- /dev/null +++ b/provider-ci/providers/aws/repo/.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/provider-ci/providers/aws/repo/Makefile b/provider-ci/providers/aws/repo/Makefile new file mode 100644 index 000000000..9cb6540d1 --- /dev/null +++ b/provider-ci/providers/aws/repo/Makefile @@ -0,0 +1,131 @@ +# WARNING: This file is autogenerated - changes will be overwritten if not made via https://github.com/pulumi/ci-mgmt + +PACK := aws +ORG := pulumi +PROJECT := github.com/$(ORG)/pulumi-$(PACK) +PROVIDER_PATH := provider/v6 +VERSION_PATH := $(PROVIDER_PATH)/pkg/version.Version +TFGEN := pulumi-tfgen-$(PACK) +PROVIDER := pulumi-resource-$(PACK) +VERSION := $(shell pulumictl get version) +JAVA_GEN := pulumi-java-gen +JAVA_GEN_VERSION := v0.9.5 +TESTPARALLELISM := 10 +WORKING_DIR := $(shell pwd) +PULUMI_PROVIDER_BUILD_PARALLELISM ?= -p 2 + +development: install_plugins provider build_sdks install_sdks + +build: install_plugins provider build_sdks install_sdks + +build_sdks: build_nodejs build_python build_go build_dotnet build_java + +install_go_sdk: + +install_java_sdk: + +install_python_sdk: + +install_sdks: install_dotnet_sdk install_python_sdk install_nodejs_sdk install_java_sdk + +only_build: build + +build_dotnet: DOTNET_VERSION := $(shell pulumictl get version --language dotnet) +build_dotnet: upstream + pulumictl get version --language dotnet + $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ + cd sdk/dotnet/ && \ + printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ + echo "$(DOTNET_VERSION)" >version.txt && \ + dotnet build /p:Version=$(DOTNET_VERSION) + +build_go: upstream + $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ + cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs go build + +build_java: PACKAGE_VERSION := $(shell pulumictl get version --language generic) +build_java: bin/pulumi-java-gen upstream + $(WORKING_DIR)/bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus + cd sdk/java/ && \ + printf "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ + gradle --console=plain build + +build_nodejs: VERSION := $(shell pulumictl get version --language javascript) +build_nodejs: upstream + $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ + cd sdk/nodejs/ && \ + printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ + yarn install && \ + yarn run tsc && \ + cp ../../README.md ../../LICENSE* package.json yarn.lock ./bin/ && \ + sed -i.bak -e "s/\$${VERSION}/$(VERSION)/g" ./bin/package.json + +build_python: PYPI_VERSION := $(shell pulumictl get version --language python) +build_python: upstream + $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ + cd sdk/python/ && \ + printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ + cp ../../README.md . && \ + python3 setup.py clean --all 2>/dev/null && \ + rm -rf ./bin/ ../python.bin/ && cp -R . ../python.bin && mv ../python.bin ./bin && \ + sed -i.bak -e 's/^VERSION = .*/VERSION = "$(PYPI_VERSION)"/g' -e 's/^PLUGIN_VERSION = .*/PLUGIN_VERSION = "$(VERSION)"/g' ./bin/setup.py && \ + rm ./bin/setup.py.bak && rm ./bin/go.mod && \ + cd ./bin && python3 setup.py build sdist + +clean: + rm -rf sdk/{dotnet,nodejs,go,python} + +cleanup: + rm -r $(WORKING_DIR)/bin + rm -f provider/cmd/$(PROVIDER)/schema.go + +help: + @grep '^[^.#]\+:\s\+.*#' Makefile | \ + sed "s/\(.\+\):\s*\(.*\) #\s*\(.*\)/`printf "\033[93m"`\1`printf "\033[0m"` \3 [\2]/" | \ + expand -t20 + +install_dotnet_sdk: + mkdir -p $(WORKING_DIR)/nuget + find . -name '*.nupkg' -print -exec cp -p {} $(WORKING_DIR)/nuget \; + +install_nodejs_sdk: + yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin + +install_plugins: + [ -x "$(shell command -v pulumi 2>/dev/null)" ] || curl -fsSL https://get.pulumi.com | sh + pulumi plugin install resource archive 0.0.1 + pulumi plugin install resource tls 4.10.0 + pulumi plugin install resource github 4.10.0 + pulumi plugin install resource kubernetes 3.17.0 + pulumi plugin install resource random 4.8.2 + pulumi plugin install resource github 5.14.0 + +lint_provider: provider + cd provider && golangci-lint run -c ../.golangci.yml + +provider: tfgen install_plugins + (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(PROVIDER) -ldflags "-X $(PROJECT)/$(VERSION_PATH)=$(VERSION) -X github.com/hashicorp/terraform-provider-aws/version.ProviderVersion=$(VERSION)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(PROVIDER)) + +test: + cd examples && go test -v -tags=all -parallel $(TESTPARALLELISM) -timeout 2h + +tfgen: install_plugins upstream + (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "-X $(PROJECT)/$(VERSION_PATH)=$(VERSION)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) + $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) + (cd provider && VERSION=$(VERSION) go generate cmd/$(PROVIDER)/main.go) + +upstream: +ifneq ("$(wildcard upstream)","") + @$(SHELL) ./scripts/upstream.sh "$@" apply +endif + +upstream.finalize: + @$(SHELL) ./scripts/upstream.sh "$@" end_rebase + +upstream.rebase: + @$(SHELL) ./scripts/upstream.sh "$@" start_rebase + +bin/pulumi-java-gen: + $(shell pulumictl download-binary -n pulumi-language-java -v $(JAVA_GEN_VERSION) -r pulumi/pulumi-java) + +.PHONY: development build build_sdks install_go_sdk install_java_sdk install_python_sdk install_sdks only_build build_dotnet build_go build_java build_nodejs build_python clean cleanup help install_dotnet_sdk install_nodejs_sdk install_plugins lint_provider provider test tfgen upstream upstream.finalize upstream.rebase diff --git a/provider-ci/providers/aws/repo/scripts/upstream.sh b/provider-ci/providers/aws/repo/scripts/upstream.sh new file mode 100644 index 000000000..eddab76e9 --- /dev/null +++ b/provider-ci/providers/aws/repo/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 <