diff --git a/.github/workflows/build_sdk.yml b/.github/workflows/build_sdk.yml new file mode 100644 index 00000000..2452807d --- /dev/null +++ b/.github/workflows/build_sdk.yml @@ -0,0 +1,99 @@ +name: "Build SDK" + +on: + workflow_call: {} + +jobs: + build_sdk: + name: build_sdk + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - uses: pulumi/provider-version-action@v1 + with: + set-env: 'PROVIDER_VERSION' + - name: Cache examples generation + uses: actions/cache@v4 + with: + path: | + .pulumi/examples-cache + key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} + - name: Install pulumictl + uses: jaxxstorm/action-install-gh-release@v1.11.0 + with: + tag: v0.0.46 + repo: pulumi/pulumictl + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20.x + registry-url: https://registry.npmjs.org + - name: Setup DotNet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 6.0.x + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.11.8 + - name: Setup Java + uses: actions/setup-java@v4 + with: + cache: gradle + distribution: temurin + java-version: 11 + - name: Setup Gradle + uses: gradle/gradle-build-action@v3 + with: + gradle-version: 7.6 + - name: Download provider + tfgen binaries + uses: actions/download-artifact@v4 + with: + name: vault-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-*-vault" -print -exec chmod +x {} \; + - name: Install plugins + run: make install_plugins + - name: Update path + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + - name: Build SDK + run: make build_${{ matrix.language }} + - name: Check worktree clean + uses: pulumi/git-status-check-action@v1 + with: + allowed-changes: | + sdk/**/pulumi-plugin.json + sdk/dotnet/Pulumi.*.csproj + sdk/go/**/pulumiUtilities.go + sdk/nodejs/package.json + sdk/python/pyproject.toml + - name: Compress SDK folder + run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . + - name: Upload artifacts + uses: actions/upload-artifact@v4 + 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 }} diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index e2024e7e..be820672 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -23,107 +23,8 @@ jobs: build_sdk: name: build_sdk needs: prerequisites - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - uses: pulumi/provider-version-action@v1 - with: - set-env: 'PROVIDER_VERSION' - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: "1.21.x" - cache-dependency-path: | - sdk/go.sum - - name: Cache examples generation - uses: actions/cache@v4 - with: - path: | - .pulumi/examples-cache - key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.11.0 - with: - tag: v0.0.46 - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/actions@v5 - with: - pulumi-version: "^3" - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: "20.x" - registry-url: https://registry.npmjs.org - - name: Setup DotNet - uses: actions/setup-dotnet@v4 - with: - dotnet-version: "6.0.x" - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: "3.11.8" - - name: Setup Java - uses: actions/setup-java@v4 - with: - cache: gradle - distribution: temurin - java-version: "11" - - name: Setup Gradle - uses: gradle/gradle-build-action@v3 - with: - gradle-version: "7.6" - - name: Download provider + tfgen binaries - uses: actions/download-artifact@v4 - with: - name: vault-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-*-vault" -print -exec chmod +x {} \; - - name: Install plugins - run: make install_plugins - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Build SDK - run: make build_${{ matrix.language }} - - name: Check worktree clean - uses: pulumi/git-status-check-action@v1 - with: - allowed-changes: | - sdk/**/pulumi-plugin.json - sdk/dotnet/Pulumi.*.csproj - sdk/go/**/pulumiUtilities.go - sdk/nodejs/package.json - sdk/python/pyproject.toml - - name: Compress SDK folder - run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . - - name: Upload artifacts - uses: actions/upload-artifact@v4 - 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 + uses: ./.github/workflows/build_sdk.yml + secrets: inherit generate_coverage_data: continue-on-error: true @@ -188,92 +89,12 @@ jobs: uses: ./.github/workflows/license.yml secrets: inherit prerequisites: - name: prerequisites - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - uses: pulumi/provider-version-action@v1 - with: - set-env: 'PROVIDER_VERSION' - - name: Cache examples generation - uses: actions/cache@v4 - with: - path: | - .pulumi/examples-cache - key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Prepare upstream code - run: make upstream - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: "1.21.x" - cache-dependency-path: | - provider/*.sum - upstream/*.sum - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.11.0 - with: - tag: v0.0.46 - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/actions@v5 - with: - pulumi-version: "^3" - - if: github.event_name == 'pull_request' - name: Install Schema Tools - uses: jaxxstorm/action-install-gh-release@v1.11.0 - with: - repo: pulumi/schema-tools - - name: Build schema generator binary - run: make tfgen_build_only - - name: Install plugins - run: make install_plugins - - name: Generate schema - run: make tfgen_no_deps - - name: Build provider binary - run: make provider_no_deps - - name: Unit-test provider code - run: make test_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 vault -o ${{ github.event.repository.default_branch }} -n --local-path=provider/cmd/pulumi-resource-vault/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: >+ - ${{ 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-vault - pulumi-tfgen-vault - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: vault-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 }} - + uses: ./.github/workflows/prerequisites.yml + secrets: inherit + with: + default_branch: ${{ github.event.repository.default_branch }} + is_pr: ${{ github.event_name == 'pull_request' }} + is_automated: ${{ github.actor == 'dependabot[bot]' }} publish: name: publish diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 82938193..9e38ab87 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -24,107 +24,8 @@ jobs: build_sdk: name: build_sdk needs: prerequisites - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - uses: pulumi/provider-version-action@v1 - with: - set-env: 'PROVIDER_VERSION' - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: "1.21.x" - cache-dependency-path: | - sdk/go.sum - - name: Cache examples generation - uses: actions/cache@v4 - with: - path: | - .pulumi/examples-cache - key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.11.0 - with: - tag: v0.0.46 - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/actions@v5 - with: - pulumi-version: "^3" - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: "20.x" - registry-url: https://registry.npmjs.org - - name: Setup DotNet - uses: actions/setup-dotnet@v4 - with: - dotnet-version: "6.0.x" - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: "3.11.8" - - name: Setup Java - uses: actions/setup-java@v4 - with: - cache: gradle - distribution: temurin - java-version: "11" - - name: Setup Gradle - uses: gradle/gradle-build-action@v3 - with: - gradle-version: "7.6" - - name: Download provider + tfgen binaries - uses: actions/download-artifact@v4 - with: - name: vault-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-*-vault" -print -exec chmod +x {} \; - - name: Install plugins - run: make install_plugins - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Build SDK - run: make build_${{ matrix.language }} - - name: Check worktree clean - uses: pulumi/git-status-check-action@v1 - with: - allowed-changes: | - sdk/**/pulumi-plugin.json - sdk/dotnet/Pulumi.*.csproj - sdk/go/**/pulumiUtilities.go - sdk/nodejs/package.json - sdk/python/pyproject.toml - - name: Compress SDK folder - run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . - - name: Upload artifacts - uses: actions/upload-artifact@v4 - 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 + uses: ./.github/workflows/build_sdk.yml + secrets: inherit lint: name: lint @@ -135,92 +36,12 @@ jobs: uses: ./.github/workflows/license.yml secrets: inherit prerequisites: - name: prerequisites - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - uses: pulumi/provider-version-action@v1 - with: - set-env: 'PROVIDER_VERSION' - - name: Cache examples generation - uses: actions/cache@v4 - with: - path: | - .pulumi/examples-cache - key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Prepare upstream code - run: make upstream - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: "1.21.x" - cache-dependency-path: | - provider/*.sum - upstream/*.sum - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.11.0 - with: - tag: v0.0.46 - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/actions@v5 - with: - pulumi-version: "^3" - - if: github.event_name == 'pull_request' - name: Install Schema Tools - uses: jaxxstorm/action-install-gh-release@v1.11.0 - with: - repo: pulumi/schema-tools - - name: Build schema generator binary - run: make tfgen_build_only - - name: Install plugins - run: make install_plugins - - name: Generate schema - run: make tfgen_no_deps - - name: Build provider binary - run: make provider_no_deps - - name: Unit-test provider code - run: make test_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 vault -o ${{ github.event.repository.default_branch }} -n --local-path=provider/cmd/pulumi-resource-vault/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: >+ - ${{ 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-vault - pulumi-tfgen-vault - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: vault-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 }} - + uses: ./.github/workflows/prerequisites.yml + secrets: inherit + with: + default_branch: ${{ github.event.repository.default_branch }} + is_pr: ${{ github.event_name == 'pull_request' }} + is_automated: ${{ github.actor == 'dependabot[bot]' }} publish: name: publish diff --git a/.github/workflows/prerequisites.yml b/.github/workflows/prerequisites.yml new file mode 100644 index 00000000..6093892c --- /dev/null +++ b/.github/workflows/prerequisites.yml @@ -0,0 +1,102 @@ +name: "Prerequisites" + +on: + workflow_call: + inputs: + is_pr: + type: boolean + required: true + is_automated: + type: boolean + required: true + default_branch: + type: string + required: true + +jobs: + prerequisites: + name: prerequisites + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - uses: pulumi/provider-version-action@v1 + with: + set-env: 'PROVIDER_VERSION' + - name: Cache examples generation + uses: actions/cache@v4 + with: + path: | + .pulumi/examples-cache + key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} + - name: Prepare upstream code + run: make upstream + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: "1.21.x" + cache-dependency-path: | + provider/*.sum + upstream/*.sum + - name: Install pulumictl + uses: jaxxstorm/action-install-gh-release@v1.11.0 + with: + tag: v0.0.46 + repo: pulumi/pulumictl + - name: Install Pulumi CLI + uses: pulumi/actions@v5 + with: + pulumi-version: "^3" + - if: inputs.is_pr + name: Install Schema Tools + uses: jaxxstorm/action-install-gh-release@v1.11.0 + with: + repo: pulumi/schema-tools + - name: Build schema generator binary + run: make tfgen_build_only + - name: Install plugins + run: make install_plugins + - name: Generate schema + run: make tfgen_no_deps + - name: Build provider binary + run: make provider_no_deps + - name: Unit-test provider code + run: make test_provider + - if: inputs.is_pr + 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 vault -o ${{ inputs.default_branch }} -n --local-path=provider/cmd/pulumi-resource-vault/schema.json; + echo "$EOF"; + } >> "$GITHUB_ENV" + - if: inputs.is_pr && inputs.is_automated == false + 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: >+ + ${{ 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-vault + pulumi-tfgen-vault + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: vault-provider.tar.gz + path: ${{ github.workspace }}/bin/provider.tar.gz + retention-days: 30 + - if: failure() && inputs.is_pr + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in building provider prerequisites + fields: repo,commit,author,action + status: ${{ job.status }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 491de9b2..9952708b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,123 +23,26 @@ jobs: build_sdk: name: build_sdk needs: prerequisites - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - uses: pulumi/provider-version-action@v1 - with: - set-env: 'PROVIDER_VERSION' - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: "1.21.x" - cache-dependency-path: | - sdk/go.sum - - name: Cache examples generation - uses: actions/cache@v4 - with: - path: | - .pulumi/examples-cache - key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.11.0 - with: - tag: v0.0.46 - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/actions@v5 - with: - pulumi-version: "^3" - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: "20.x" - registry-url: https://registry.npmjs.org - - name: Setup DotNet - uses: actions/setup-dotnet@v4 - with: - dotnet-version: "6.0.x" - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: "3.11.8" - - name: Setup Java - uses: actions/setup-java@v4 - with: - cache: gradle - distribution: temurin - java-version: "11" - - name: Setup Gradle - uses: gradle/gradle-build-action@v3 - with: - gradle-version: "7.6" - - name: Download provider + tfgen binaries - uses: actions/download-artifact@v4 - with: - name: vault-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-*-vault" -print -exec chmod +x {} \; - - name: Install plugins - run: make install_plugins - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Build SDK - run: make build_${{ matrix.language }} - - name: Check worktree clean - uses: pulumi/git-status-check-action@v1 - with: - allowed-changes: | - sdk/**/pulumi-plugin.json - sdk/dotnet/Pulumi.*.csproj - sdk/go/**/pulumiUtilities.go - sdk/nodejs/package.json - sdk/python/pyproject.toml - - name: Compress SDK folder - run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . - - name: Upload artifacts - uses: actions/upload-artifact@v4 - 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 + uses: ./.github/workflows/build_sdk.yml + secrets: inherit 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.11.0 - with: - tag: v0.0.46 - repo: pulumi/pulumictl - - env: - GITHUB_TOKEN: ${{ secrets.PULUMI_BOT_TOKEN }} - name: Dispatch Event - run: pulumictl create docs-build pulumi-vault - "${GITHUB_REF#refs/tags/}" + - name: Dispatch Metadata build + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.PULUMI_BOT_TOKEN }} + repository: pulumi/registry + event-type: resource-provider + client-payload: |- + { + "project": "${{ github.repository }}", + "project-shortname": "vault", + "ref": "${{ github.ref_name }}" + } lint: name: lint uses: ./.github/workflows/lint.yml @@ -149,92 +52,12 @@ jobs: uses: ./.github/workflows/license.yml secrets: inherit prerequisites: - name: prerequisites - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - uses: pulumi/provider-version-action@v1 - with: - set-env: 'PROVIDER_VERSION' - - name: Cache examples generation - uses: actions/cache@v4 - with: - path: | - .pulumi/examples-cache - key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Prepare upstream code - run: make upstream - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: "1.21.x" - cache-dependency-path: | - provider/*.sum - upstream/*.sum - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.11.0 - with: - tag: v0.0.46 - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/actions@v5 - with: - pulumi-version: "^3" - - if: github.event_name == 'pull_request' - name: Install Schema Tools - uses: jaxxstorm/action-install-gh-release@v1.11.0 - with: - repo: pulumi/schema-tools - - name: Build schema generator binary - run: make tfgen_build_only - - name: Install plugins - run: make install_plugins - - name: Generate schema - run: make tfgen_no_deps - - name: Build provider binary - run: make provider_no_deps - - name: Unit-test provider code - run: make test_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 vault -o ${{ github.event.repository.default_branch }} -n --local-path=provider/cmd/pulumi-resource-vault/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: >+ - ${{ 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-vault - pulumi-tfgen-vault - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: vault-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 }} - + uses: ./.github/workflows/prerequisites.yml + secrets: inherit + with: + default_branch: ${{ github.event.repository.default_branch }} + is_pr: ${{ github.event_name == 'pull_request' }} + is_automated: ${{ github.actor == 'dependabot[bot]' }} publish: name: publish diff --git a/.github/workflows/run-acceptance-tests.yml b/.github/workflows/run-acceptance-tests.yml index dab961e7..c89a49d6 100644 --- a/.github/workflows/run-acceptance-tests.yml +++ b/.github/workflows/run-acceptance-tests.yml @@ -31,109 +31,8 @@ jobs: 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@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - - uses: pulumi/provider-version-action@v1 - with: - set-env: 'PROVIDER_VERSION' - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: "1.21.x" - cache-dependency-path: | - sdk/go.sum - - name: Cache examples generation - uses: actions/cache@v4 - with: - path: | - .pulumi/examples-cache - key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.11.0 - with: - tag: v0.0.46 - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/actions@v5 - with: - pulumi-version: "^3" - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: "20.x" - registry-url: https://registry.npmjs.org - - name: Setup DotNet - uses: actions/setup-dotnet@v4 - with: - dotnet-version: "6.0.x" - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: "3.11.8" - - name: Setup Java - uses: actions/setup-java@v4 - with: - cache: gradle - distribution: temurin - java-version: "11" - - name: Setup Gradle - uses: gradle/gradle-build-action@v3 - with: - gradle-version: "7.6" - - name: Download provider + tfgen binaries - uses: actions/download-artifact@v4 - with: - name: vault-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-*-vault" -print -exec chmod +x {} \; - - name: Install plugins - run: make install_plugins - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Build SDK - run: make build_${{ matrix.language }} - - name: Check worktree clean - uses: pulumi/git-status-check-action@v1 - with: - allowed-changes: | - sdk/**/pulumi-plugin.json - sdk/dotnet/Pulumi.*.csproj - sdk/go/**/pulumiUtilities.go - sdk/nodejs/package.json - sdk/python/pyproject.toml - - name: Compress SDK folder - run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . - - name: Upload artifacts - uses: actions/upload-artifact@v4 - 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 + uses: ./.github/workflows/build_sdk.yml + secrets: inherit comment-notification: if: github.event_name == 'repository_dispatch' @@ -159,92 +58,12 @@ jobs: 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@v4 - - uses: pulumi/provider-version-action@v1 - with: - set-env: 'PROVIDER_VERSION' - - name: Cache examples generation - uses: actions/cache@v4 - with: - path: | - .pulumi/examples-cache - key: ${{ runner.os }}-${{ hashFiles('provider/go.sum') }} - - name: Prepare upstream code - run: make upstream - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: "1.21.x" - cache-dependency-path: | - provider/*.sum - upstream/*.sum - - name: Install pulumictl - uses: jaxxstorm/action-install-gh-release@v1.11.0 - with: - tag: v0.0.46 - repo: pulumi/pulumictl - - name: Install Pulumi CLI - uses: pulumi/actions@v5 - with: - pulumi-version: "^3" - - if: github.event_name == 'pull_request' - name: Install Schema Tools - uses: jaxxstorm/action-install-gh-release@v1.11.0 - with: - repo: pulumi/schema-tools - - name: Build schema generator binary - run: make tfgen_build_only - - name: Install plugins - run: make install_plugins - - name: Generate schema - run: make tfgen_no_deps - - name: Build provider binary - run: make provider_no_deps - - name: Unit-test provider code - run: make test_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 vault -o ${{ github.event.repository.default_branch }} -n --local-path=provider/cmd/pulumi-resource-vault/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: >+ - ${{ 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-vault - pulumi-tfgen-vault - - name: Upload artifacts - uses: actions/upload-artifact@v4 - with: - name: vault-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 }} - + uses: ./.github/workflows/prerequisites.yml + secrets: inherit + with: + default_branch: ${{ github.event.repository.default_branch }} + is_pr: ${{ github.event_name == 'pull_request' }} + is_automated: ${{ github.actor == 'dependabot[bot]' }} sentinel: name: sentinel