Skip to content

Commit

Permalink
Use setup-tools everywhere (#1003)
Browse files Browse the repository at this point in the history
Commits are factored for review:

1. Use setup-tools anywhere we're installing go, pulumicli, pulumictl
2. Remove unused pulumictl install for Go SDK release job
3. Now we only have one use of each setup step, inline the tool versions
and remove from the config.
4. Also inline `slash-command` and `create-or-update-comment` actions as
they're only used once.
5. Specify tools explicitly for the verify-release job.
6. Re-generate test-providers.
  • Loading branch information
danielrbradley authored Jun 26, 2024
1 parent d660bf5 commit 3642d32
Show file tree
Hide file tree
Showing 37 changed files with 154 additions and 979 deletions.
13 changes: 0 additions & 13 deletions provider-ci/internal/pkg/templates/bridged-provider.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,27 +133,14 @@ runner:
# actionVersions should be used wherever we use external actions to make upgrading easier.
# These are never overridden by providers: https://github.com/search?q=org%3Apulumi+path%3A.ci-mgmt.yaml+%22actionVersions%3A%22&type=code
actionVersions:
setupGo: actions/setup-go@v5
setupDotNet: actions/setup-dotnet@v4
setupJava: actions/setup-java@v4
setupGradle: gradle/gradle-build-action@v3
setupNode: actions/setup-node@v4
setupPulumi: pulumi/actions@v5
setupPython: actions/setup-python@v5

configureAwsCredentials: aws-actions/configure-aws-credentials@v4
setupGcloud: google-github-actions/setup-gcloud@v2
googleAuth: google-github-actions/auth@v2
goReleaser: goreleaser/goreleaser-action@v5
installGhRelease: jaxxstorm/action-install-gh-release@v1.11.0
checkout: actions/checkout@v4
pulumictlTag: v0.0.46
cleanupArtifact: c-hive/gha-remove-artifacts@v1
createOrUpdateComment: peter-evans/create-or-update-comment@v1
downloadArtifact: actions/download-artifact@v4
pathsFilter: dorny/paths-filter@v2
prComment: thollander/actions-comment-pull-request@v2
slashCommand: peter-evans/slash-command-dispatch@v2
uploadArtifact: actions/upload-artifact@v4
upgradeProviderAction: pulumi/pulumi-upgrade-provider-action@v0.0.12

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@ jobs:
name: Check for upstream provider upgrades
runs-on: #{{ .Config.runner.default }}#
steps:
- name: Install Go
uses: #{{ .Config.actionVersions.setupGo }}#
with:
go-version: "#{{ .Config.toolVersions.go }}#"
cache-dependency-path: |
sdk/go.sum
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
with:
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
tools: go
- name: Install upgrade-provider
run: go install github.com/pulumi/upgrade-provider@main
shell: bash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,10 @@ jobs:
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: Install Go
uses: #{{ .Config.actionVersions.setupGo }}#
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
go-version: "#{{ .Config.toolVersions.go }}#"
cache-dependency-path: |
sdk/go.sum
- name: Install pulumictl
uses: #{{ .Config.actionVersions.installGhRelease }}#
with:
tag: #{{ .Config.actionVersions.pulumictlTag }}#
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: #{{ .Config.actionVersions.setupPulumi }}#
with:
pulumi-version: "#{{ .Config.toolVersions.pulumi }}#"
- if: github.event_name == 'pull_request'
name: Install Schema Tools
uses: #{{ .Config.actionVersions.installGhRelease }}#
with:
repo: pulumi/schema-tools
tools: pulumictl, pulumicli, go, schema-tools
- name: Echo Coverage Output Dir
run: 'echo "Coverage output directory: ${{ env.COVERAGE_OUTPUT_DIR }}"'
- name: Generate Coverage Data
Expand Down Expand Up @@ -113,21 +97,10 @@ jobs:
with:
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
- name: Install Go
uses: #{{ .Config.actionVersions.setupGo }}#
with:
go-version: "#{{ .Config.toolVersions.go }}#"
cache-dependency-path: |
sdk/go.sum
- name: Install pulumictl
uses: #{{ .Config.actionVersions.installGhRelease }}#
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
tag: #{{ .Config.actionVersions.pulumictlTag }}#
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: #{{ .Config.actionVersions.setupPulumi }}#
with:
pulumi-version: "#{{ .Config.toolVersions.pulumi }}#"
tools: pulumictl, pulumicli, go
- name: Configure AWS Credentials
uses: #{{ .Config.actionVersions.configureAwsCredentials }}#
with:
Expand Down Expand Up @@ -208,44 +181,10 @@ jobs:
with:
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
- name: Install Go
uses: #{{ .Config.actionVersions.setupGo }}#
with:
go-version: "#{{ .Config.toolVersions.go }}#"
cache-dependency-path: |
sdk/go.sum
- name: Install pulumictl
uses: #{{ .Config.actionVersions.installGhRelease }}#
with:
tag: #{{ .Config.actionVersions.pulumictlTag }}#
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: #{{ .Config.actionVersions.setupPulumi }}#
with:
pulumi-version: "#{{ .Config.toolVersions.pulumi }}#"
- name: Setup Node
uses: #{{ .Config.actionVersions.setupNode }}#
with:
node-version: "#{{ .Config.toolVersions.node }}#"
registry-url: https://registry.npmjs.org
- name: Setup DotNet
uses: #{{ .Config.actionVersions.setupDotNet }}#
with:
dotnet-version: "#{{ .Config.toolVersions.dotnet }}#"
- name: Setup Python
uses: #{{ .Config.actionVersions.setupPython }}#
with:
python-version: "#{{ .Config.toolVersions.python }}#"
- name: Setup Java
uses: #{{ .Config.actionVersions.setupJava }}#
with:
cache: gradle
distribution: temurin
java-version: "#{{ .Config.toolVersions.java }}#"
- name: Setup Gradle
uses: #{{ .Config.actionVersions.setupGradle }}#
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
gradle-version: "#{{ .Config.toolVersions.gradle }}#"
tools: pulumictl, pulumicli, go, node, dotnet, python, java
- name: Download provider + tfgen binaries
uses: #{{ .Config.actionVersions.downloadArtifact }}#
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,44 +46,10 @@ jobs:
with:
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
- name: Install Go
uses: #{{ .Config.actionVersions.setupGo }}#
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
go-version: "#{{ .Config.toolVersions.go }}#"
cache-dependency-path: |
sdk/go.sum
- name: Install pulumictl
uses: #{{ .Config.actionVersions.installGhRelease }}#
with:
tag: #{{ .Config.actionVersions.pulumictlTag }}#
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: #{{ .Config.actionVersions.setupPulumi }}#
with:
pulumi-version: "#{{ .Config.toolVersions.pulumi }}#"
- name: Setup Node
uses: #{{ .Config.actionVersions.setupNode }}#
with:
node-version: "#{{ .Config.toolVersions.node }}#"
registry-url: https://registry.npmjs.org
- name: Setup DotNet
uses: #{{ .Config.actionVersions.setupDotNet }}#
with:
dotnet-version: "#{{ .Config.toolVersions.dotnet }}#"
- name: Setup Python
uses: #{{ .Config.actionVersions.setupPython }}#
with:
python-version: "#{{ .Config.toolVersions.python }}#"
- name: Setup Java
uses: #{{ .Config.actionVersions.setupJava }}#
with:
cache: gradle
distribution: temurin
java-version: "#{{ .Config.toolVersions.java }}#"
- name: Setup Gradle
uses: #{{ .Config.actionVersions.setupGradle }}#
with:
gradle-version: "#{{ .Config.toolVersions.gradle }}#"
tools: pulumictl, pulumicli, go, node, dotnet, python, java
- name: Download provider + tfgen binaries
uses: #{{ .Config.actionVersions.downloadArtifact }}#
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,10 @@ jobs:
with:
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
- name: Install Go
uses: #{{ .Config.actionVersions.setupGo }}#
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
go-version: "#{{ .Config.toolVersions.go }}#"
cache-dependency-path: |
sdk/go.sum
- name: Install pulumictl
uses: #{{ .Config.actionVersions.installGhRelease }}#
with:
tag: #{{ .Config.actionVersions.pulumictlTag }}#
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: #{{ .Config.actionVersions.setupPulumi }}#
with:
pulumi-version: "#{{ .Config.toolVersions.pulumi }}#"
tools: pulumictl, pulumicli, go
- name: Configure AWS Credentials
uses: #{{ .Config.actionVersions.configureAwsCredentials }}#
with:
Expand Down Expand Up @@ -120,11 +109,6 @@ jobs:
with:
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
- name: Install pulumictl
uses: #{{ .Config.actionVersions.installGhRelease }}#
with:
tag: #{{ .Config.actionVersions.pulumictlTag }}#
repo: pulumi/pulumictl
- name: Download Go SDK
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -174,44 +158,10 @@ jobs:
with:
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
- name: Install Go
uses: #{{ .Config.actionVersions.setupGo }}#
with:
go-version: "#{{ .Config.toolVersions.go }}#"
cache-dependency-path: |
sdk/go.sum
- name: Install pulumictl
uses: #{{ .Config.actionVersions.installGhRelease }}#
with:
tag: #{{ .Config.actionVersions.pulumictlTag }}#
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: #{{ .Config.actionVersions.setupPulumi }}#
with:
pulumi-version: "#{{ .Config.toolVersions.pulumi }}#"
- name: Setup Node
uses: #{{ .Config.actionVersions.setupNode }}#
with:
node-version: "#{{ .Config.toolVersions.node }}#"
registry-url: https://registry.npmjs.org
- name: Setup DotNet
uses: #{{ .Config.actionVersions.setupDotNet }}#
with:
dotnet-version: "#{{ .Config.toolVersions.dotnet }}#"
- name: Setup Python
uses: #{{ .Config.actionVersions.setupPython }}#
with:
python-version: "#{{ .Config.toolVersions.python }}#"
- name: Setup Java
uses: #{{ .Config.actionVersions.setupJava }}#
with:
cache: gradle
distribution: temurin
java-version: "#{{ .Config.toolVersions.java }}#"
- name: Setup Gradle
uses: #{{ .Config.actionVersions.setupGradle }}#
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
gradle-version: "#{{ .Config.toolVersions.gradle }}#"
tools: pulumictl, pulumicli, go, node, dotnet, python, java
- name: Download provider + tfgen binaries
uses: #{{ .Config.actionVersions.downloadArtifact }}#
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,10 @@ jobs:
with:
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
- name: Install Go
uses: #{{ .Config.actionVersions.setupGo }}#
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
go-version: "#{{ .Config.toolVersions.go }}#"
cache-dependency-path: |
sdk/go.sum
- name: Install pulumictl
uses: #{{ .Config.actionVersions.installGhRelease }}#
with:
tag: #{{ .Config.actionVersions.pulumictlTag }}#
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: #{{ .Config.actionVersions.setupPulumi }}#
with:
pulumi-version: "#{{ .Config.toolVersions.pulumi }}#"
tools: pulumictl, pulumicli, go
- name: Configure AWS Credentials
uses: #{{ .Config.actionVersions.configureAwsCredentials }}#
with:
Expand Down Expand Up @@ -136,11 +125,6 @@ jobs:
with:
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
- name: Install pulumictl
uses: #{{ .Config.actionVersions.installGhRelease }}#
with:
tag: #{{ .Config.actionVersions.pulumictlTag }}#
repo: pulumi/pulumictl
#{{- if .Config.publish.goSdk.usePush }}#
- name: Download Go SDK
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -216,44 +200,10 @@ jobs:
with:
submodules: #{{ .Config.checkoutSubmodules }}#
#{{- end }}#
- name: Install Go
uses: #{{ .Config.actionVersions.setupGo }}#
with:
go-version: "#{{ .Config.toolVersions.go }}#"
cache-dependency-path: |
sdk/go.sum
- name: Install pulumictl
uses: #{{ .Config.actionVersions.installGhRelease }}#
with:
tag: #{{ .Config.actionVersions.pulumictlTag }}#
repo: pulumi/pulumictl
- name: Install Pulumi CLI
uses: #{{ .Config.actionVersions.setupPulumi }}#
with:
pulumi-version: "#{{ .Config.toolVersions.pulumi }}#"
- name: Setup Node
uses: #{{ .Config.actionVersions.setupNode }}#
with:
node-version: "#{{ .Config.toolVersions.node }}#"
registry-url: https://registry.npmjs.org
- name: Setup DotNet
uses: #{{ .Config.actionVersions.setupDotNet }}#
with:
dotnet-version: "#{{ .Config.toolVersions.dotnet }}#"
- name: Setup Python
uses: #{{ .Config.actionVersions.setupPython }}#
with:
python-version: "#{{ .Config.toolVersions.python }}#"
- name: Setup Java
uses: #{{ .Config.actionVersions.setupJava }}#
with:
cache: gradle
distribution: temurin
java-version: "#{{ .Config.toolVersions.java }}#"
- name: Setup Gradle
uses: #{{ .Config.actionVersions.setupGradle }}#
- name: Setup tools
uses: ./.github/actions/setup-tools
with:
gradle-version: "#{{ .Config.toolVersions.gradle }}#"
tools: pulumictl, pulumicli, go, node, dotnet, python, java
- name: Download provider + tfgen binaries
uses: #{{ .Config.actionVersions.downloadArtifact }}#
with:
Expand Down
Loading

0 comments on commit 3642d32

Please sign in to comment.