diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml index 7b9b917d2..7d4172ebd 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/main.yml @@ -90,9 +90,6 @@ jobs: - build_provider - test - license_check - #{{- range $action, $_ := .Config.ExtraTests }}# - - #{{ $action }}# - #{{- end }}# uses: ./.github/workflows/publish.yml secrets: inherit with: @@ -120,117 +117,15 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} test: - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: #{{ if .Config.Runner.BuildSDK }}##{{- .Config.Runner.BuildSDK }}##{{ else }}##{{- .Config.Runner.Default }}##{{ end }}# - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - #{{- if .Config.FreeDiskSpaceBeforeTest }}# - # Run as first step so we don't delete things that have just been installed - - name: Free Disk Space (Ubuntu) - uses: #{{ .Config.ActionVersions.FreeDiskSpace }}# - with: - tool-cache: false - swap-storage: false - dotnet: false - #{{- end }}# - - name: Checkout Repo - uses: #{{ .Config.ActionVersions.Checkout }}# - with: - #{{- if .Config.CheckoutSubmodules }}# - submodules: #{{ .Config.CheckoutSubmodules }}# - #{{- end }}# - persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, ${{ matrix.language }} - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - run: |- - pip3 install virtualenv==20.0.23 - pip3 install pipenv - #{{- if .Config.Docker }}# - - name: Run docker compose - run: docker compose -f testing/docker-compose.yml up --build -d - #{{- end }}# - #{{- if .Config.AWS }}# - - name: Configure AWS Credentials - uses: #{{ .Config.ActionVersions.ConfigureAwsCredentials }}# - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 7200 - role-session-name: #{{ .Config.Provider }}#@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - #{{- end }}# - #{{- if .Config.GCP }}# - - name: Authenticate to Google Cloud - uses: #{{ .Config.ActionVersions.GoogleAuth }}# - with: - service_account: ${{ env.GOOGLE_CI_SERVICE_ACCOUNT_EMAIL }} - workload_identity_provider: projects/${{ env.GOOGLE_PROJECT_NUMBER - }}/locations/global/workloadIdentityPools/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_POOL }}/providers/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER }} - - name: Setup gcloud auth - uses: #{{ .Config.ActionVersions.SetupGcloud }}# - with: - install_components: gke-gcloud-auth-plugin - #{{- end }}# - #{{- if .Config.GCPRegistry }}# - - name: Login to Google Cloud Registry - run: gcloud --quiet auth configure-docker - #{{- end }}# - #{{- if index .Config.SetupScript }}# - - name: Run setup script - run: #{{ index .Config.SetupScript }}# - #{{- end }}# - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.5.0 -#{{- if .Config.Actions.PreTest }}# -#{{ .Config.Actions.PreTest | toYaml | indent 4 }}# -#{{- end }}# -#{{- if .Config.IntegrationTestProvider }}# - - name: Run provider tests - working-directory: provider - run: go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 - #{{- end }}# - - name: Run tests - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 - strategy: - fail-fast: false - matrix: - language: -#{{ .Config.Languages | toYaml | indent 8 }}# -#{{- if .Config.ExtraTests }}# -#{{ .Config.ExtraTests | toYaml | indent 2 }}# -#{{ end }}# + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + name: #{{ .Config.ProviderDefaultBranch }}# on: workflow_dispatch: {} diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml index 93ca9294a..80491a72c 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/nightly-test.yml @@ -28,115 +28,15 @@ jobs: version: ${{ needs.prerequisites.outputs.version }} test: - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: #{{ if .Config.Runner.BuildSDK }}##{{- .Config.Runner.BuildSDK }}##{{ else }}##{{- .Config.Runner.Default }}##{{ end }}# - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: -#{{- if .Config.FreeDiskSpaceBeforeTest }}# - # Run as first step so we don't delete things that have just been installed - - name: Free Disk Space (Ubuntu) - uses: #{{ .Config.ActionVersions.FreeDiskSpace }}# - with: - tool-cache: false - swap-storage: false - dotnet: false -#{{- end }}# - - name: Checkout Repo - uses: #{{ .Config.ActionVersions.Checkout }}# - with: - #{{- if .Config.CheckoutSubmodules }}# - submodules: #{{ .Config.CheckoutSubmodules }}# - #{{- end }}# - persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, ${{ matrix.language}} - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - run: |- - pip3 install virtualenv==20.0.23 - pip3 install pipenv - #{{- if .Config.Docker }}# - - name: Run docker compose - run: docker compose -f testing/docker-compose.yml up --build -d - #{{- end }}# - #{{- if .Config.AWS }}# - - name: Configure AWS Credentials - uses: #{{ .Config.ActionVersions.ConfigureAwsCredentials }}# - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 7200 - role-session-name: #{{ .Config.provider }}#@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - #{{- end }}# - #{{- if .Config.GCP }}# - - name: Authenticate to Google Cloud - uses: #{{ .Config.ActionVersions.GoogleAuth }}# - with: - service_account: ${{ env.GOOGLE_CI_SERVICE_ACCOUNT_EMAIL }} - workload_identity_provider: projects/${{ env.GOOGLE_PROJECT_NUMBER - }}/locations/global/workloadIdentityPools/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_POOL }}/providers/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER }} - - name: Setup gcloud auth - uses: #{{ .Config.ActionVersions.SetupGcloud }}# - with: - install_components: gke-gcloud-auth-plugin - #{{- end }}# - #{{- if .Config.GCPRegistry }}# - - name: Login to Google Cloud Registry - run: gcloud --quiet auth configure-docker - #{{- end }}# - #{{- if index .Config.SetupScript }}# - - name: Run setup script - run: #{{ index .Config.SetupScript }}# - #{{- end }}# - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.5.0 -#{{- if .Config.Actions.PreTest }}# -#{{ .Config.Actions.PreTest | toYaml | indent 4 }}# -#{{- end }}# - #{{- if .Config.IntegrationTestProvider }}# - - name: Run provider tests - if: matrix.testTarget == 'local' - working-directory: provider - run: go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . - #{{- end }}# - - name: Run tests - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 - strategy: - fail-fast: false - matrix: - language: -#{{ .Config.Languages | toYaml | indent 10 }}# + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + name: cron on: schedule: diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml index 307ed624c..860fc3a66 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerelease.yml @@ -48,9 +48,6 @@ jobs: - build_provider - test - license_check - #{{- range $action, $_ := .Config.ExtraTests }}# - - #{{ $action }}# - #{{- end }}# uses: ./.github/workflows/publish.yml secrets: inherit with: @@ -58,117 +55,14 @@ jobs: isPrerelease: true test: - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: #{{ if .Config.Runner.BuildSDK }}##{{- .Config.Runner.BuildSDK }}##{{ else }}##{{- .Config.Runner.Default }}##{{ end }}# - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: -#{{- if .Config.FreeDiskSpaceBeforeTest }}# - # Run as first step so we don't delete things that have just been installed - - name: Free Disk Space (Ubuntu) - uses: #{{ .Config.ActionVersions.FreeDiskSpace }}# - with: - tool-cache: false - swap-storage: false - dotnet: false -#{{- end }}# - - name: Checkout Repo - uses: #{{ .Config.ActionVersions.Checkout }}# - with: - #{{- if .Config.CheckoutSubmodules }}# - submodules: #{{ .Config.CheckoutSubmodules }}# - #{{- end }}# - persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, #{{ range $index, $element := .Config.Languages }}##{{if $index}}#, #{{end}}##{{ $element }}##{{end}}# - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - run: |- - pip3 install virtualenv==20.0.23 - pip3 install pipenv - #{{- if .Config.Docker }}# - - name: Run docker compose - run: docker compose -f testing/docker-compose.yml up --build -d - #{{- end }}# - #{{- if .Config.AWS }}# - - name: Configure AWS Credentials - uses: #{{ .Config.ActionVersions.ConfigureAwsCredentials }}# - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 7200 - role-session-name: #{{ .Config.Provider }}#@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - #{{- end }}# - #{{- if .Config.GCP }}# - - name: Authenticate to Google Cloud - uses: #{{ .Config.ActionVersions.GoogleAuth }}# - with: - service_account: ${{ env.GOOGLE_CI_SERVICE_ACCOUNT_EMAIL }} - workload_identity_provider: projects/${{ env.GOOGLE_PROJECT_NUMBER - }}/locations/global/workloadIdentityPools/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_POOL }}/providers/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER }} - - name: Setup gcloud auth - uses: #{{ .Config.ActionVersions.SetupGcloud }}# - with: - install_components: gke-gcloud-auth-plugin - #{{- end }}# - #{{- if .Config.GCPRegistry }}# - - name: Login to Google Cloud Registry - run: gcloud --quiet auth configure-docker - #{{- end }}# - #{{- if index .Config.SetupScript }}# - - name: Run setup script - run: #{{ index .Config.SetupScript }}# - #{{- end }}# - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.5.0 -#{{- if .Config.Actions.PreTest }}# -#{{ .Config.Actions.PreTest | toYaml | indent 4 }}# -#{{- end }}# - #{{- if .Config.IntegrationTestProvider }}# - - name: Run provider tests - working-directory: provider - run: go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . - #{{- end }}# - - name: Run tests - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . - strategy: - fail-fast: false - matrix: - language: -#{{ .Config.Languages | toYaml | indent 8 }}# -#{{- if .Config.ExtraTests }}# -#{{ .Config.ExtraTests | toYaml | indent 2 }}# -#{{ end }}# + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} name: prerelease on: diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml index e88b97b18..93acf0197 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/release.yml @@ -57,9 +57,6 @@ jobs: - build_provider - test - license_check - #{{- range $action, $_ := .Config.ExtraTests }}# - - #{{ $action }}# - #{{- end }}# uses: ./.github/workflows/publish.yml secrets: inherit with: @@ -67,114 +64,11 @@ jobs: isPrerelease: false test: - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: #{{ if .Config.Runner.BuildSDK }}##{{- .Config.Runner.BuildSDK }}##{{ else }}##{{- .Config.Runner.Default }}##{{ end }}# - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: -#{{- if .Config.FreeDiskSpaceBeforeTest }}# - # Run as first step so we don't delete things that have just been installed - - name: Free Disk Space (Ubuntu) - uses: #{{ .Config.ActionVersions.FreeDiskSpace }}# - with: - tool-cache: false - swap-storage: false - dotnet: false -#{{- end }}# - - name: Checkout Repo - uses: #{{ .Config.ActionVersions.Checkout }}# - with: - #{{- if .Config.CheckoutSubmodules }}# - submodules: #{{ .Config.CheckoutSubmodules }}# - #{{- end }}# - persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, ${{ matrix.language }} - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - run: |- - pip3 install virtualenv==20.0.23 - pip3 install pipenv - #{{- if .Config.Docker }}# - - name: Run docker compose - run: docker compose -f testing/docker-compose.yml up --build -d - #{{- end }}# - #{{- if .Config.AWS }}# - - name: Configure AWS Credentials - uses: #{{ .Config.ActionVersions.ConfigureAwsCredentials }}# - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 7200 - role-session-name: #{{ .Config.Provider }}#@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - #{{- end }}# - #{{- if .Config.GCP }}# - - name: Authenticate to Google Cloud - uses: #{{ .Config.ActionVersions.GoogleAuth }}# - with: - service_account: ${{ env.GOOGLE_CI_SERVICE_ACCOUNT_EMAIL }} - workload_identity_provider: projects/${{ env.GOOGLE_PROJECT_NUMBER - }}/locations/global/workloadIdentityPools/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_POOL }}/providers/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER }} - - name: Setup gcloud auth - uses: #{{ .Config.ActionVersions.SetupGcloud }}# - with: - install_components: gke-gcloud-auth-plugin - #{{- end }}# - #{{- if .Config.GCPRegistry }}# - - name: Login to Google Cloud Registry - run: gcloud --quiet auth configure-docker - #{{- end }}# - #{{- if index .Config.SetupScript }}# - - name: Run setup script - run: #{{ index .Config.SetupScript }}# - #{{- end }}# - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.5.0 -#{{- if .Config.Actions.PreTest }}# -#{{ .Config.Actions.PreTest | toYaml | indent 4 }}# -#{{- end }}# - #{{- if .Config.IntegrationTestProvider }}# - - name: Run provider tests - working-directory: provider - run: go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . - #{{- end }}# - - name: Run tests - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . - strategy: - fail-fast: false - matrix: - language: -#{{ .Config.Languages | toYaml | indent 8 }}# -#{{- if .Config.ExtraTests }}# -#{{ .Config.ExtraTests | toYaml | indent 2 }}# -#{{ end }}# + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml index aa18658f9..b7298fa3c 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/run-acceptance-tests.yml @@ -88,9 +88,6 @@ jobs: #{{- if .Config.Lint }}# - lint #{{- end }}# - #{{- range $action, $_ := .Config.ExtraTests }}# - - #{{ $action }}# - #{{- end }}# runs-on: #{{ .Config.Runner.Default }}# steps: - uses: guibranco/github-status-action-v2@0849440ec82c5fa69b2377725b9b7852a3977e76 # v1.1.13 @@ -106,137 +103,19 @@ jobs: sha: ${{ github.event.pull_request.head.sha || github.sha }} test: + # Don't run tests on PRs from forks. if: github.event_name == 'repository_dispatch' || github.event.pull_request.head.repo.full_name == github.repository - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: #{{ if .Config.Runner.BuildSDK }}##{{- .Config.Runner.BuildSdk }}##{{ else }}##{{- .Config.Runner.Default }}##{{ end }}# - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: -#{{- if .Config.FreeDiskSpaceBeforeTest }}# - # Run as first step so we don't delete things that have just been installed - - name: Free Disk Space (Ubuntu) - uses: #{{ .Config.ActionVersions.FreeDiskSpace }}# - with: - tool-cache: false - swap-storage: false - dotnet: false -#{{- end }}# - - name: Checkout Repo - uses: #{{ .Config.ActionVersions.Checkout }}# - with: - ref: ${{ env.PR_COMMIT_SHA }} - #{{- if .Config.CheckoutSubmodules }}# - submodules: #{{ .Config.CheckoutSubmodules }}# - #{{- end }}# - persist-credentials: false - - name: Checkout p/examples - if: matrix.testTarget == 'pulumiExamples' - uses: #{{ .Config.ActionVersions.Checkout }}# - with: - repository: pulumi/examples - path: p-examples - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, ${{ matrix.language }} - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - run: |- - pip3 install virtualenv==20.0.23 - pip3 install pipenv - #{{- if .Config.Docker }}# - - name: Run docker compose - run: docker compose -f testing/docker-compose.yml up --build -d - #{{- end }}# - #{{- if .Config.AWS }}# - - name: Configure AWS Credentials - uses: #{{ .Config.ActionVersions.ConfigureAwsCredentials }}# - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 7200 - role-session-name: #{{ .Config.Provider }}#@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - #{{- end }}# - #{{- if .Config.GCP }}# - - name: Authenticate to Google Cloud - uses: #{{ .Config.ActionVersions.GoogleAuth }}# - with: - service_account: ${{ env.GOOGLE_CI_SERVICE_ACCOUNT_EMAIL }} - workload_identity_provider: projects/${{ env.GOOGLE_PROJECT_NUMBER - }}/locations/global/workloadIdentityPools/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_POOL }}/providers/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER }} - - name: Setup gcloud auth - uses: #{{ .Config.ActionVersions.SetupGcloud }}# - with: - install_components: gke-gcloud-auth-plugin - #{{- end }}# - #{{- if .Config.GCPRegistry }}# - - name: Login to Google Cloud Registry - run: gcloud --quiet auth configure-docker - #{{- end }}# - #{{- if index .Config.SetupScript }}# - - name: Run setup script - run: #{{ index .Config.SetupScript }}# - #{{- end }}# - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.5.0 -#{{- if .Config.Actions.PreTest }}# -#{{ .Config.Actions.PreTest | toYaml | indent 4 }}# -#{{- end }}# - #{{- if .Config.IntegrationTestProvider }}# - - name: Run provider tests - if: matrix.testTarget == 'local' - working-directory: provider - run: go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . - #{{- end }}# - - name: Run tests - if: matrix.testTarget == 'local' - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . - - name: Run pulumi/examples tests - if: matrix.testTarget == 'pulumiExamples' - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -run TestPulumiExamples -parallel 4 . - strategy: - fail-fast: false - matrix: - language: -#{{ .Config.Languages | toYaml | indent 8 }}# - #{{- if .Config.TestPulumiExamples }}# - testTarget: [local, pulumiExamples] - #{{- else }}# - testTarget: [local] - #{{- end }}# + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + license_check: name: License Check uses: ./.github/workflows/license.yml secrets: inherit -#{{- if .Config.ExtraTests }}# -#{{ .Config.ExtraTests | toYaml | indent 2 }}# -#{{ end }}# diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/test.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/test.yml new file mode 100644 index 000000000..ebe30846a --- /dev/null +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/test.yml @@ -0,0 +1,139 @@ +name: "Test Provider" + +on: + workflow_call: + inputs: + version: + required: true + type: string + description: Version of the provider to test + +env: + PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} +#{{ .Config.Env | toYaml | indent 2 }}# + +jobs: + test: + permissions: + contents: read + id-token: write + runs-on: #{{ if .Config.Runner.BuildSDK }}##{{- .Config.Runner.BuildSdk }}##{{ else }}##{{- .Config.Runner.Default }}##{{ end }}# + env: + PROVIDER_VERSION: ${{ inputs.version }} + steps: +#{{- if .Config.FreeDiskSpaceBeforeTest }}# + # Run as first step so we don't delete things that have just been installed + - name: Free Disk Space (Ubuntu) + uses: #{{ .Config.ActionVersions.FreeDiskSpace }}# + with: + tool-cache: false + swap-storage: false + dotnet: false +#{{- end }}# + - name: Checkout Repo + uses: #{{ .Config.ActionVersions.Checkout }}# + with: + ref: ${{ env.PR_COMMIT_SHA }} + #{{- if .Config.CheckoutSubmodules }}# + submodules: #{{ .Config.CheckoutSubmodules }}# + #{{- end }}# + persist-credentials: false + - name: Checkout p/examples + if: matrix.testTarget == 'pulumiExamples' + uses: #{{ .Config.ActionVersions.Checkout }}# + with: + repository: pulumi/examples + path: p-examples + - name: Setup tools + uses: ./.github/actions/setup-tools + with: + tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace + - name: Download bin + uses: ./.github/actions/download-bin + - name: Download SDK + uses: ./.github/actions/download-sdk + with: + language: ${{ matrix.language }} + - name: Restore makefile progress + run: make --touch provider schema build_${{ matrix.language }} + - name: Update path + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + - name: Install Python deps + if: matrix.language == 'python' + run: |- + pip3 install virtualenv==20.0.23 + pip3 install pipenv + #{{- if .Config.Docker }}# + - name: Run docker compose + run: docker compose -f testing/docker-compose.yml up --build -d + #{{- end }}# + #{{- if .Config.AWS }}# + - name: Configure AWS Credentials + uses: #{{ .Config.ActionVersions.ConfigureAwsCredentials }}# + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-region: ${{ env.AWS_REGION }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + role-duration-seconds: 7200 + role-session-name: #{{ .Config.Provider }}#@githubActions + role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} + #{{- end }}# + #{{- if .Config.GCP }}# + - name: Authenticate to Google Cloud + uses: #{{ .Config.ActionVersions.GoogleAuth }}# + with: + service_account: ${{ env.GOOGLE_CI_SERVICE_ACCOUNT_EMAIL }} + workload_identity_provider: projects/${{ env.GOOGLE_PROJECT_NUMBER + }}/locations/global/workloadIdentityPools/${{ + env.GOOGLE_CI_WORKLOAD_IDENTITY_POOL }}/providers/${{ + env.GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER }} + - name: Setup gcloud auth + uses: #{{ .Config.ActionVersions.SetupGcloud }}# + with: + install_components: gke-gcloud-auth-plugin + #{{- end }}# + #{{- if .Config.GCPRegistry }}# + - name: Login to Google Cloud Registry + run: gcloud --quiet auth configure-docker + #{{- end }}# + #{{- if index .Config.SetupScript }}# + - name: Run setup script + run: #{{ index .Config.SetupScript }}# + #{{- end }}# + - name: Install dependencies + run: make install_${{ matrix.language}}_sdk + - name: Install gotestfmt + uses: GoTestTools/gotestfmt-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: v2.5.0 +#{{- if .Config.Actions.PreTest }}# +#{{ .Config.Actions.PreTest | toYaml | indent 4 }}# +#{{- end }}# + #{{- if .Config.IntegrationTestProvider }}# + - name: Run provider tests + if: matrix.testTarget == 'local' + working-directory: provider + run: go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . + #{{- end }}# + - name: Run tests + if: matrix.testTarget == 'local' + run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . + - name: Run pulumi/examples tests + if: matrix.testTarget == 'pulumiExamples' + run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -run TestPulumiExamples -parallel 4 . + strategy: + fail-fast: false + matrix: + language: +#{{ .Config.Languages | toYaml | indent 8 }}# + #{{- if .Config.TestPulumiExamples }}# + testTarget: [local, pulumiExamples] + #{{- else }}# + testTarget: [local] + #{{- end }}# +#{{- if .Config.ExtraTests }}# +#{{ .Config.ExtraTests | toYaml | indent 2 }}# +#{{ end }}# diff --git a/provider-ci/test-providers/acme/.github/workflows/main.yml b/provider-ci/test-providers/acme/.github/workflows/main.yml index 1fa989877..4a76498dc 100644 --- a/provider-ci/test-providers/acme/.github/workflows/main.yml +++ b/provider-ci/test-providers/acme/.github/workflows/main.yml @@ -126,60 +126,15 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} test: - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, ${{ matrix.language }} - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - 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.5.0 - - name: Run tests - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 - strategy: - fail-fast: false - matrix: - language: - - dotnet - - go - - nodejs - - python + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + name: main on: workflow_dispatch: {} diff --git a/provider-ci/test-providers/acme/.github/workflows/prerelease.yml b/provider-ci/test-providers/acme/.github/workflows/prerelease.yml index ff5493000..2dffdec67 100644 --- a/provider-ci/test-providers/acme/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/acme/.github/workflows/prerelease.yml @@ -67,60 +67,14 @@ jobs: isPrerelease: true test: - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, dotnet, go, nodejs, python - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - 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.5.0 - - name: Run tests - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . - strategy: - fail-fast: false - matrix: - language: - - dotnet - - go - - nodejs - - python + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} name: prerelease on: diff --git a/provider-ci/test-providers/acme/.github/workflows/release.yml b/provider-ci/test-providers/acme/.github/workflows/release.yml index e9d7643fc..ac7ff2213 100644 --- a/provider-ci/test-providers/acme/.github/workflows/release.yml +++ b/provider-ci/test-providers/acme/.github/workflows/release.yml @@ -73,57 +73,11 @@ jobs: isPrerelease: false test: - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, ${{ matrix.language }} - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - 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.5.0 - - name: Run tests - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . - strategy: - fail-fast: false - matrix: - language: - - dotnet - - go - - nodejs - - python + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} diff --git a/provider-ci/test-providers/acme/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/acme/.github/workflows/run-acceptance-tests.yml index af3c84592..24bbd8cf7 100644 --- a/provider-ci/test-providers/acme/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/acme/.github/workflows/run-acceptance-tests.yml @@ -113,74 +113,17 @@ jobs: sha: ${{ github.event.pull_request.head.sha || github.sha }} test: + # Don't run tests on PRs from forks. if: github.event_name == 'repository_dispatch' || - github.event.pull_request.head.repo.full_name == github.repository - name: test + github.event.pull_request.head.repo.full_name == github.repository + uses: ./.github/workflows/test.yml needs: - prerequisites - - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - ref: ${{ env.PR_COMMIT_SHA }} - persist-credentials: false - - name: Checkout p/examples - if: matrix.testTarget == 'pulumiExamples' - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - repository: pulumi/examples - path: p-examples - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, ${{ matrix.language }} - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - 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.5.0 - - name: Run tests - if: matrix.testTarget == 'local' - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . - - name: Run pulumi/examples tests - if: matrix.testTarget == 'pulumiExamples' - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -run TestPulumiExamples -parallel 4 . - strategy: - fail-fast: false - matrix: - language: - - dotnet - - go - - nodejs - - python - testTarget: [local] + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + license_check: name: License Check uses: ./.github/workflows/license.yml diff --git a/provider-ci/test-providers/acme/.github/workflows/test.yml b/provider-ci/test-providers/acme/.github/workflows/test.yml new file mode 100644 index 000000000..60a3ba0ef --- /dev/null +++ b/provider-ci/test-providers/acme/.github/workflows/test.yml @@ -0,0 +1,92 @@ +name: "Test Provider" + +on: + workflow_call: + inputs: + version: + required: true + type: string + description: Version of the provider to test + +env: + PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + 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 + PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + PYPI_USERNAME: __token__ + SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }} + SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }} + SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }} + TF_APPEND_USER_AGENT: pulumi + +jobs: + test: + permissions: + contents: read + id-token: write + runs-on: ubuntu-latest + env: + PROVIDER_VERSION: ${{ inputs.version }} + steps: + - name: Checkout Repo + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ env.PR_COMMIT_SHA }} + persist-credentials: false + - name: Checkout p/examples + if: matrix.testTarget == 'pulumiExamples' + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + repository: pulumi/examples + path: p-examples + - name: Setup tools + uses: ./.github/actions/setup-tools + with: + tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace + - name: Download bin + uses: ./.github/actions/download-bin + - name: Download SDK + uses: ./.github/actions/download-sdk + with: + language: ${{ matrix.language }} + - name: Restore makefile progress + run: make --touch provider schema build_${{ matrix.language }} + - name: Update path + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + - name: Install Python deps + if: matrix.language == 'python' + 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.5.0 + - name: Run tests + if: matrix.testTarget == 'local' + run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . + - name: Run pulumi/examples tests + if: matrix.testTarget == 'pulumiExamples' + run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -run TestPulumiExamples -parallel 4 . + strategy: + fail-fast: false + matrix: + language: + - dotnet + - go + - nodejs + - python + testTarget: [local] diff --git a/provider-ci/test-providers/aws/.ci-mgmt.yaml b/provider-ci/test-providers/aws/.ci-mgmt.yaml index 721dbc72f..a98ffffe3 100644 --- a/provider-ci/test-providers/aws/.ci-mgmt.yaml +++ b/provider-ci/test-providers/aws/.ci-mgmt.yaml @@ -116,7 +116,6 @@ extraTests: test_oidc: name: test_oidc - needs: build_sdk permissions: contents: read id-token: write @@ -197,7 +196,6 @@ extraTests: provider_test: name: provider_test - needs: build_sdk permissions: contents: read id-token: write diff --git a/provider-ci/test-providers/aws/.github/workflows/master.yml b/provider-ci/test-providers/aws/.github/workflows/master.yml index fbff70f0c..46d9d95c8 100644 --- a/provider-ci/test-providers/aws/.github/workflows/master.yml +++ b/provider-ci/test-providers/aws/.github/workflows/master.yml @@ -99,10 +99,6 @@ jobs: - build_provider - test - license_check - - go_test_shim - - provider_test - - test_oidc - - upstream_lint uses: ./.github/workflows/publish.yml secrets: inherit with: @@ -130,297 +126,14 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} test: - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - # Run as first step so we don't delete things that have just been installed - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: false - swap-storage: false - dotnet: false - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - submodules: true - persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, ${{ matrix.language }} - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - 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.5.0 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 3600 - role-session-name: aws@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Make upstream - run: make upstream - - name: Run tests - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - go_test_shim: - name: Run test of provider shim - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: pulumi/provider-version-action@v1 - with: - set-env: PROVIDER_VERSION - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumi, go - - name: Make upstream - run: make upstream - - name: go test - run: | - cd upstream - go get github.com/hashicorp/aws-sdk-go-base@v1.1.0 - cd shim - go test -v -coverprofile="coverage.txt" . - - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4 - timeout-minutes: 60 - provider_test: - name: provider_test - needs: build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - swap-storage: false - tool-cache: false - - name: Checkout Repo - uses: actions/checkout@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: pulumi/provider-version-action@v1 - with: - set-env: PROVIDER_VERSION - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumi, go, node, dotnet, python, java - - name: Make upstream - run: make upstream - - name: Download provider + tfgen binaries - uses: actions/download-artifact@v4 - with: - name: aws-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-*-aws" -print -exec chmod +x {} \; - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: actions/download-artifact@v4 - with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} - - name: 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.5.0 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 3600 - role-session-name: aws@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - if: failure() && github.event_name == 'push' - name: Notify Slack - uses: 8398a7/action-slack@v3 - with: - author_name: Failure in running ${{ matrix.language }} provider tests - fields: repo,commit,author,action - status: ${{ job.status }} - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - test_oidc: - name: test_oidc - needs: build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - dotnet: ${{ matrix.language != 'dotnet' }} - swap-storage: false - tool-cache: false - - name: Checkout Repo - uses: actions/checkout@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: pulumi/provider-version-action@v1 - with: - set-env: PROVIDER_VERSION - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumi, go, node - - name: Download provider + tfgen binaries - uses: actions/download-artifact@v4 - with: - name: aws-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-*-aws" -print -exec chmod +x {} \; - - name: Download SDK - uses: actions/download-artifact@v4 - with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - 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: Make upstream - run: make upstream - - name: Run selected tests with manual web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - name: Configure AWS Credentials for OIDC - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-region: ${{ env.AWS_REGION }} - role-duration-seconds: 3600 - role-session-name: aws@githubActions - role-to-assume: ${{ secrets.OIDC_ROLE_ARN }} - unset-current-credentials: true - - name: Run selected tests with configure-aws-credentials web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - 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 - upstream_lint: - name: Run upstream provider-lint - runs-on: ubuntu-latest - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - swap-storage: false - tool-cache: false - - name: Checkout Repo - uses: actions/checkout@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - name: Install Go - uses: actions/setup-go@v5 - with: - cache: false - go-version: 1.22.x - - name: Make upstream - run: make upstream - - name: upstream lint - run: | - cd upstream - make provider-lint - timeout-minutes: 60 + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} name: master on: diff --git a/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml b/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml index 9cde20cb2..c4228a9f7 100644 --- a/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml +++ b/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml @@ -45,80 +45,15 @@ jobs: version: ${{ needs.prerequisites.outputs.version }} test: - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - # Run as first step so we don't delete things that have just been installed - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: false - swap-storage: false - dotnet: false - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - submodules: true - persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, ${{ matrix.language}} - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - 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.5.0 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 3600 - role-session-name: aws@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Make upstream - run: make upstream - - name: Run tests - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + name: cron on: schedule: diff --git a/provider-ci/test-providers/aws/.github/workflows/prerelease.yml b/provider-ci/test-providers/aws/.github/workflows/prerelease.yml index b7a4f3802..1912cb457 100644 --- a/provider-ci/test-providers/aws/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/aws/.github/workflows/prerelease.yml @@ -59,10 +59,6 @@ jobs: - build_provider - test - license_check - - go_test_shim - - provider_test - - test_oidc - - upstream_lint uses: ./.github/workflows/publish.yml secrets: inherit with: @@ -70,298 +66,14 @@ jobs: isPrerelease: true test: - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - # Run as first step so we don't delete things that have just been installed - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: false - swap-storage: false - dotnet: false - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - submodules: true - persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, nodejs, python, dotnet, go, java - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - 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.5.0 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 3600 - role-session-name: aws@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Make upstream - run: make upstream - - name: Run tests - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - go_test_shim: - name: Run test of provider shim - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: pulumi/provider-version-action@v1 - with: - set-env: PROVIDER_VERSION - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumi, go - - name: Make upstream - run: make upstream - - name: go test - run: | - cd upstream - go get github.com/hashicorp/aws-sdk-go-base@v1.1.0 - cd shim - go test -v -coverprofile="coverage.txt" . - - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4 - timeout-minutes: 60 - provider_test: - name: provider_test - needs: build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - swap-storage: false - tool-cache: false - - name: Checkout Repo - uses: actions/checkout@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: pulumi/provider-version-action@v1 - with: - set-env: PROVIDER_VERSION - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumi, go, node, dotnet, python, java - - name: Make upstream - run: make upstream - - name: Download provider + tfgen binaries - uses: actions/download-artifact@v4 - with: - name: aws-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-*-aws" -print -exec chmod +x {} \; - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: actions/download-artifact@v4 - with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} - - name: 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.5.0 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 3600 - role-session-name: aws@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - if: failure() && github.event_name == 'push' - name: Notify Slack - uses: 8398a7/action-slack@v3 - with: - author_name: Failure in running ${{ matrix.language }} provider tests - fields: repo,commit,author,action - status: ${{ job.status }} - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - test_oidc: - name: test_oidc - needs: build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - dotnet: ${{ matrix.language != 'dotnet' }} - swap-storage: false - tool-cache: false - - name: Checkout Repo - uses: actions/checkout@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: pulumi/provider-version-action@v1 - with: - set-env: PROVIDER_VERSION - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumi, go, node - - name: Download provider + tfgen binaries - uses: actions/download-artifact@v4 - with: - name: aws-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-*-aws" -print -exec chmod +x {} \; - - name: Download SDK - uses: actions/download-artifact@v4 - with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - 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: Make upstream - run: make upstream - - name: Run selected tests with manual web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - name: Configure AWS Credentials for OIDC - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-region: ${{ env.AWS_REGION }} - role-duration-seconds: 3600 - role-session-name: aws@githubActions - role-to-assume: ${{ secrets.OIDC_ROLE_ARN }} - unset-current-credentials: true - - name: Run selected tests with configure-aws-credentials web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - 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 - upstream_lint: - name: Run upstream provider-lint - runs-on: ubuntu-latest - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - swap-storage: false - tool-cache: false - - name: Checkout Repo - uses: actions/checkout@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - name: Install Go - uses: actions/setup-go@v5 - with: - cache: false - go-version: 1.22.x - - name: Make upstream - run: make upstream - - name: upstream lint - run: | - cd upstream - make provider-lint - timeout-minutes: 60 - + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} name: prerelease on: diff --git a/provider-ci/test-providers/aws/.github/workflows/release.yml b/provider-ci/test-providers/aws/.github/workflows/release.yml index 3390e4ca6..e80c5c1b1 100644 --- a/provider-ci/test-providers/aws/.github/workflows/release.yml +++ b/provider-ci/test-providers/aws/.github/workflows/release.yml @@ -65,10 +65,6 @@ jobs: - build_provider - test - license_check - - go_test_shim - - provider_test - - test_oidc - - upstream_lint uses: ./.github/workflows/publish.yml secrets: inherit with: @@ -76,295 +72,11 @@ jobs: isPrerelease: false test: - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - # Run as first step so we don't delete things that have just been installed - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: false - swap-storage: false - dotnet: false - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - submodules: true - persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, ${{ matrix.language }} - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - 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.5.0 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 3600 - role-session-name: aws@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Make upstream - run: make upstream - - name: Run tests - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - go_test_shim: - name: Run test of provider shim - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: pulumi/provider-version-action@v1 - with: - set-env: PROVIDER_VERSION - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumi, go - - name: Make upstream - run: make upstream - - name: go test - run: | - cd upstream - go get github.com/hashicorp/aws-sdk-go-base@v1.1.0 - cd shim - go test -v -coverprofile="coverage.txt" . - - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4 - timeout-minutes: 60 - provider_test: - name: provider_test - needs: build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - swap-storage: false - tool-cache: false - - name: Checkout Repo - uses: actions/checkout@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: pulumi/provider-version-action@v1 - with: - set-env: PROVIDER_VERSION - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumi, go, node, dotnet, python, java - - name: Make upstream - run: make upstream - - name: Download provider + tfgen binaries - uses: actions/download-artifact@v4 - with: - name: aws-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-*-aws" -print -exec chmod +x {} \; - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: actions/download-artifact@v4 - with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} - - name: 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.5.0 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 3600 - role-session-name: aws@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - if: failure() && github.event_name == 'push' - name: Notify Slack - uses: 8398a7/action-slack@v3 - with: - author_name: Failure in running ${{ matrix.language }} provider tests - fields: repo,commit,author,action - status: ${{ job.status }} - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - test_oidc: - name: test_oidc - needs: build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - dotnet: ${{ matrix.language != 'dotnet' }} - swap-storage: false - tool-cache: false - - name: Checkout Repo - uses: actions/checkout@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: pulumi/provider-version-action@v1 - with: - set-env: PROVIDER_VERSION - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumi, go, node - - name: Download provider + tfgen binaries - uses: actions/download-artifact@v4 - with: - name: aws-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-*-aws" -print -exec chmod +x {} \; - - name: Download SDK - uses: actions/download-artifact@v4 - with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - 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: Make upstream - run: make upstream - - name: Run selected tests with manual web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - name: Configure AWS Credentials for OIDC - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-region: ${{ env.AWS_REGION }} - role-duration-seconds: 3600 - role-session-name: aws@githubActions - role-to-assume: ${{ secrets.OIDC_ROLE_ARN }} - unset-current-credentials: true - - name: Run selected tests with configure-aws-credentials web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - 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 - upstream_lint: - name: Run upstream provider-lint - runs-on: ubuntu-latest - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - swap-storage: false - tool-cache: false - - name: Checkout Repo - uses: actions/checkout@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - name: Install Go - uses: actions/setup-go@v5 - with: - cache: false - go-version: 1.22.x - - name: Make upstream - run: make upstream - - name: upstream lint - run: | - cd upstream - make provider-lint - timeout-minutes: 60 - + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} diff --git a/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml index c6d8f967b..b01204a61 100644 --- a/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/aws/.github/workflows/run-acceptance-tests.yml @@ -94,10 +94,6 @@ jobs: - test - build_provider - license_check - - go_test_shim - - provider_test - - test_oidc - - upstream_lint runs-on: ubuntu-latest steps: - uses: guibranco/github-status-action-v2@0849440ec82c5fa69b2377725b9b7852a3977e76 # v1.1.13 @@ -113,313 +109,18 @@ jobs: sha: ${{ github.event.pull_request.head.sha || github.sha }} test: + # Don't run tests on PRs from forks. if: github.event_name == 'repository_dispatch' || - github.event.pull_request.head.repo.full_name == github.repository - name: test + github.event.pull_request.head.repo.full_name == github.repository + uses: ./.github/workflows/test.yml needs: - prerequisites - - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - # Run as first step so we don't delete things that have just been installed - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - with: - tool-cache: false - swap-storage: false - dotnet: false - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - persist-credentials: false - - name: Checkout p/examples - if: matrix.testTarget == 'pulumiExamples' - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - repository: pulumi/examples - path: p-examples - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, ${{ matrix.language }} - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - 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.5.0 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 3600 - role-session-name: aws@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Make upstream - run: make upstream - - name: Run tests - if: matrix.testTarget == 'local' - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . - - name: Run pulumi/examples tests - if: matrix.testTarget == 'pulumiExamples' - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -run TestPulumiExamples -parallel 4 . - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - testTarget: [local] + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + license_check: name: License Check uses: ./.github/workflows/license.yml secrets: inherit - go_test_shim: - name: Run test of provider shim - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: pulumi/provider-version-action@v1 - with: - set-env: PROVIDER_VERSION - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumi, go - - name: Make upstream - run: make upstream - - name: go test - run: | - cd upstream - go get github.com/hashicorp/aws-sdk-go-base@v1.1.0 - cd shim - go test -v -coverprofile="coverage.txt" . - - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4 - timeout-minutes: 60 - provider_test: - name: provider_test - needs: build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - swap-storage: false - tool-cache: false - - name: Checkout Repo - uses: actions/checkout@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: pulumi/provider-version-action@v1 - with: - set-env: PROVIDER_VERSION - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumi, go, node, dotnet, python, java - - name: Make upstream - run: make upstream - - name: Download provider + tfgen binaries - uses: actions/download-artifact@v4 - with: - name: aws-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-*-aws" -print -exec chmod +x {} \; - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: actions/download-artifact@v4 - with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} - - name: 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.5.0 - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 3600 - role-session-name: aws@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - if: failure() && github.event_name == 'push' - name: Notify Slack - uses: 8398a7/action-slack@v3 - with: - author_name: Failure in running ${{ matrix.language }} provider tests - fields: repo,commit,author,action - status: ${{ job.status }} - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - test_oidc: - name: test_oidc - needs: build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - dotnet: ${{ matrix.language != 'dotnet' }} - swap-storage: false - tool-cache: false - - name: Checkout Repo - uses: actions/checkout@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - uses: pulumi/provider-version-action@v1 - with: - set-env: PROVIDER_VERSION - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumi, go, node - - name: Download provider + tfgen binaries - uses: actions/download-artifact@v4 - with: - name: aws-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-*-aws" -print -exec chmod +x {} \; - - name: Download SDK - uses: actions/download-artifact@v4 - with: - name: ${{ matrix.language }}-sdk.tar.gz - path: ${{ github.workspace}}/sdk/ - - name: Uncompress SDK folder - run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - 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: Make upstream - run: make upstream - - name: Run selected tests with manual web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - name: Configure AWS Credentials for OIDC - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-region: ${{ env.AWS_REGION }} - role-duration-seconds: 3600 - role-session-name: aws@githubActions - role-to-assume: ${{ secrets.OIDC_ROLE_ARN }} - unset-current-credentials: true - - name: Run selected tests with configure-aws-credentials web identity/OIDC auth - run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - 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 - upstream_lint: - name: Run upstream provider-lint - runs-on: ubuntu-latest - steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - swap-storage: false - tool-cache: false - - name: Checkout Repo - uses: actions/checkout@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - name: Install Go - uses: actions/setup-go@v5 - with: - cache: false - go-version: 1.22.x - - name: Make upstream - run: make upstream - - name: upstream lint - run: | - cd upstream - make provider-lint - timeout-minutes: 60 - diff --git a/provider-ci/test-providers/aws/.github/workflows/test.yml b/provider-ci/test-providers/aws/.github/workflows/test.yml new file mode 100644 index 000000000..1964cc0e9 --- /dev/null +++ b/provider-ci/test-providers/aws/.github/workflows/test.yml @@ -0,0 +1,331 @@ +name: "Test Provider" + +on: + workflow_call: + inputs: + version: + required: true + type: string + description: Version of the provider to test + +env: + PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} + AWS_REGION: us-west-2 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} + OIDC_ROLE_ARN: ${{ secrets.OIDC_ROLE_ARN }} + 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_API_TOKEN }} + PYPI_USERNAME: __token__ + SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }} + SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }} + SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }} + TF_APPEND_USER_AGENT: pulumi + +jobs: + test: + permissions: + contents: read + id-token: write + runs-on: ubuntu-latest + env: + PROVIDER_VERSION: ${{ inputs.version }} + steps: + # Run as first step so we don't delete things that have just been installed + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + with: + tool-cache: false + swap-storage: false + dotnet: false + - name: Checkout Repo + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ env.PR_COMMIT_SHA }} + submodules: true + persist-credentials: false + - name: Checkout p/examples + if: matrix.testTarget == 'pulumiExamples' + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + repository: pulumi/examples + path: p-examples + - name: Setup tools + uses: ./.github/actions/setup-tools + with: + tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace + - name: Download bin + uses: ./.github/actions/download-bin + - name: Download SDK + uses: ./.github/actions/download-sdk + with: + language: ${{ matrix.language }} + - name: Restore makefile progress + run: make --touch provider schema build_${{ matrix.language }} + - name: Update path + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + - name: Install Python deps + if: matrix.language == 'python' + 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.5.0 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-region: ${{ env.AWS_REGION }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + role-duration-seconds: 3600 + role-session-name: aws@githubActions + role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} + - name: Make upstream + run: make upstream + - name: Run tests + if: matrix.testTarget == 'local' + run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . + - name: Run pulumi/examples tests + if: matrix.testTarget == 'pulumiExamples' + run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -run TestPulumiExamples -parallel 4 . + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + testTarget: [local] + go_test_shim: + name: Run test of provider shim + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + ref: ${{ env.PR_COMMIT_SHA }} + submodules: true + - uses: pulumi/provider-version-action@v1 + with: + set-env: PROVIDER_VERSION + - name: Setup tools + uses: ./.github/actions/setup-tools + with: + tools: pulumictl, pulumi, go + - name: Make upstream + run: make upstream + - name: go test + run: | + cd upstream + go get github.com/hashicorp/aws-sdk-go-base@v1.1.0 + cd shim + go test -v -coverprofile="coverage.txt" . + - env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4 + timeout-minutes: 60 + provider_test: + name: provider_test + permissions: + contents: read + id-token: write + runs-on: ubuntu-latest + steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + swap-storage: false + tool-cache: false + - name: Checkout Repo + uses: actions/checkout@v4 + with: + ref: ${{ env.PR_COMMIT_SHA }} + submodules: true + - uses: pulumi/provider-version-action@v1 + with: + set-env: PROVIDER_VERSION + - name: Setup tools + uses: ./.github/actions/setup-tools + with: + tools: pulumictl, pulumi, go, node, dotnet, python, java + - name: Make upstream + run: make upstream + - name: Download provider + tfgen binaries + uses: actions/download-artifact@v4 + with: + name: aws-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-*-aws" -print -exec chmod +x {} \; + - run: dotnet nuget add source ${{ github.workspace }}/nuget + - name: Download SDK + uses: actions/download-artifact@v4 + with: + name: ${{ matrix.language }}-sdk.tar.gz + path: ${{ github.workspace}}/sdk/ + - name: Uncompress SDK folder + run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} + - name: 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.5.0 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-region: ${{ env.AWS_REGION }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + role-duration-seconds: 3600 + role-session-name: aws@githubActions + role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} + - name: Run provider tests + run: | + cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + - if: failure() && github.event_name == 'push' + name: Notify Slack + uses: 8398a7/action-slack@v3 + with: + author_name: Failure in running ${{ matrix.language }} provider tests + fields: repo,commit,author,action + status: ${{ job.status }} + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + test_oidc: + name: test_oidc + permissions: + contents: read + id-token: write + runs-on: ubuntu-latest + steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + dotnet: ${{ matrix.language != 'dotnet' }} + swap-storage: false + tool-cache: false + - name: Checkout Repo + uses: actions/checkout@v4 + with: + ref: ${{ env.PR_COMMIT_SHA }} + submodules: true + - uses: pulumi/provider-version-action@v1 + with: + set-env: PROVIDER_VERSION + - name: Setup tools + uses: ./.github/actions/setup-tools + with: + tools: pulumictl, pulumi, go, node + - name: Download provider + tfgen binaries + uses: actions/download-artifact@v4 + with: + name: aws-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-*-aws" -print -exec chmod +x {} \; + - name: Download SDK + uses: actions/download-artifact@v4 + with: + name: ${{ matrix.language }}-sdk.tar.gz + path: ${{ github.workspace}}/sdk/ + - name: Uncompress SDK folder + run: tar -zxf ${{ github.workspace }}/sdk/${{ matrix.language }}.tar.gz -C ${{ github.workspace }}/sdk/${{ matrix.language }} + - name: Update path + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + - 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: Make upstream + run: make upstream + - name: Run selected tests with manual web identity/OIDC auth + run: cd examples && go test -v -json -count=1 -run TestAccCloudWatchOidcManual -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + - name: Configure AWS Credentials for OIDC + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: ${{ env.AWS_REGION }} + role-duration-seconds: 3600 + role-session-name: aws@githubActions + role-to-assume: ${{ secrets.OIDC_ROLE_ARN }} + unset-current-credentials: true + - name: Run selected tests with configure-aws-credentials web identity/OIDC auth + run: cd examples && go test -v -json -count=1 -run TestAccCloudWatch -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + - 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 + upstream_lint: + name: Run upstream provider-lint + runs-on: ubuntu-latest + steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + swap-storage: false + tool-cache: false + - name: Checkout Repo + uses: actions/checkout@v4 + with: + ref: ${{ env.PR_COMMIT_SHA }} + submodules: true + - name: Install Go + uses: actions/setup-go@v5 + with: + cache: false + go-version: 1.22.x + - name: Make upstream + run: make upstream + - name: upstream lint + run: | + cd upstream + make provider-lint + timeout-minutes: 60 + diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/master.yml b/provider-ci/test-providers/cloudflare/.github/workflows/master.yml index ef03b6eec..c1830eb28 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/master.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/master.yml @@ -128,69 +128,15 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} test: - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, ${{ matrix.language }} - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - run: |- - pip3 install virtualenv==20.0.23 - pip3 install pipenv - - name: Run setup script - run: example/script.sh - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.5.0 - - name: make upstream - run: | - make upstream - - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - name: Run tests - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + name: master on: workflow_dispatch: {} diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml b/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml index 3c4dbfab0..b1fe5c654 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml @@ -69,69 +69,14 @@ jobs: isPrerelease: true test: - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, nodejs, python, dotnet, go, java - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - run: |- - pip3 install virtualenv==20.0.23 - pip3 install pipenv - - name: Run setup script - run: example/script.sh - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.5.0 - - name: make upstream - run: | - make upstream - - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - name: Run tests - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} name: prerelease on: diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/release.yml b/provider-ci/test-providers/cloudflare/.github/workflows/release.yml index 2ad5c3df0..30a15133a 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/release.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/release.yml @@ -75,66 +75,11 @@ jobs: isPrerelease: false test: - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, ${{ matrix.language }} - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - run: |- - pip3 install virtualenv==20.0.23 - pip3 install pipenv - - name: Run setup script - run: example/script.sh - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.5.0 - - name: make upstream - run: | - make upstream - - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - name: Run tests - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml index 354c38579..92875fa19 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/run-acceptance-tests.yml @@ -115,83 +115,17 @@ jobs: sha: ${{ github.event.pull_request.head.sha || github.sha }} test: + # Don't run tests on PRs from forks. if: github.event_name == 'repository_dispatch' || - github.event.pull_request.head.repo.full_name == github.repository - name: test + github.event.pull_request.head.repo.full_name == github.repository + uses: ./.github/workflows/test.yml needs: - prerequisites - - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - ref: ${{ env.PR_COMMIT_SHA }} - persist-credentials: false - - name: Checkout p/examples - if: matrix.testTarget == 'pulumiExamples' - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - repository: pulumi/examples - path: p-examples - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, ${{ matrix.language }} - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - run: |- - pip3 install virtualenv==20.0.23 - pip3 install pipenv - - name: Run setup script - run: example/script.sh - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.5.0 - - name: make upstream - run: | - make upstream - - name: Run provider tests - run: | - cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - name: Run tests - if: matrix.testTarget == 'local' - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . - - name: Run pulumi/examples tests - if: matrix.testTarget == 'pulumiExamples' - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -run TestPulumiExamples -parallel 4 . - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - testTarget: [local] + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + license_check: name: License Check uses: ./.github/workflows/license.yml diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/test.yml b/provider-ci/test-providers/cloudflare/.github/workflows/test.yml new file mode 100644 index 000000000..465a1043b --- /dev/null +++ b/provider-ci/test-providers/cloudflare/.github/workflows/test.yml @@ -0,0 +1,103 @@ +name: "Test Provider" + +on: + workflow_call: + inputs: + version: + required: true + type: string + description: Version of the provider to test + +env: + PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + 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 + PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + PYPI_USERNAME: __token__ + SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }} + SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }} + SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }} + TF_APPEND_USER_AGENT: pulumi + +jobs: + test: + permissions: + contents: read + id-token: write + runs-on: ubuntu-latest + env: + PROVIDER_VERSION: ${{ inputs.version }} + steps: + - name: Checkout Repo + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ env.PR_COMMIT_SHA }} + persist-credentials: false + - name: Checkout p/examples + if: matrix.testTarget == 'pulumiExamples' + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + repository: pulumi/examples + path: p-examples + - name: Setup tools + uses: ./.github/actions/setup-tools + with: + tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace + - name: Download bin + uses: ./.github/actions/download-bin + - name: Download SDK + uses: ./.github/actions/download-sdk + with: + language: ${{ matrix.language }} + - name: Restore makefile progress + run: make --touch provider schema build_${{ matrix.language }} + - name: Update path + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + - name: Install Python deps + if: matrix.language == 'python' + run: |- + pip3 install virtualenv==20.0.23 + pip3 install pipenv + - name: Run setup script + run: example/script.sh + - name: Install dependencies + run: make install_${{ matrix.language}}_sdk + - name: Install gotestfmt + uses: GoTestTools/gotestfmt-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: v2.5.0 + - name: make upstream + run: | + make upstream + - name: Run provider tests + run: | + cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt + - name: Run tests + if: matrix.testTarget == 'local' + run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . + - name: Run pulumi/examples tests + if: matrix.testTarget == 'pulumiExamples' + run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -run TestPulumiExamples -parallel 4 . + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + testTarget: [local] diff --git a/provider-ci/test-providers/docker/.github/workflows/master.yml b/provider-ci/test-providers/docker/.github/workflows/master.yml index 8732a3427..cc1b3ab7f 100644 --- a/provider-ci/test-providers/docker/.github/workflows/master.yml +++ b/provider-ci/test-providers/docker/.github/workflows/master.yml @@ -141,88 +141,15 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} test: - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, ${{ matrix.language }} - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - run: |- - pip3 install virtualenv==20.0.23 - pip3 install pipenv - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 7200 - role-session-name: docker@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f # v2.1.7 - with: - service_account: ${{ env.GOOGLE_CI_SERVICE_ACCOUNT_EMAIL }} - workload_identity_provider: projects/${{ env.GOOGLE_PROJECT_NUMBER - }}/locations/global/workloadIdentityPools/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_POOL }}/providers/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER }} - - name: Setup gcloud auth - uses: google-github-actions/setup-gcloud@6189d56e4096ee891640bb02ac264be376592d6a # v2.1.2 - with: - install_components: gke-gcloud-auth-plugin - - name: Login to Google Cloud Registry - run: gcloud --quiet auth configure-docker - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.5.0 - - name: Setup SSH key - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }} - - name: Run tests - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + name: master on: workflow_dispatch: {} diff --git a/provider-ci/test-providers/docker/.github/workflows/prerelease.yml b/provider-ci/test-providers/docker/.github/workflows/prerelease.yml index e3d2109b7..a6ec77820 100644 --- a/provider-ci/test-providers/docker/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/docker/.github/workflows/prerelease.yml @@ -82,88 +82,14 @@ jobs: isPrerelease: true test: - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, nodejs, python, dotnet, go, java - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - run: |- - pip3 install virtualenv==20.0.23 - pip3 install pipenv - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 7200 - role-session-name: docker@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f # v2.1.7 - with: - service_account: ${{ env.GOOGLE_CI_SERVICE_ACCOUNT_EMAIL }} - workload_identity_provider: projects/${{ env.GOOGLE_PROJECT_NUMBER - }}/locations/global/workloadIdentityPools/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_POOL }}/providers/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER }} - - name: Setup gcloud auth - uses: google-github-actions/setup-gcloud@6189d56e4096ee891640bb02ac264be376592d6a # v2.1.2 - with: - install_components: gke-gcloud-auth-plugin - - name: Login to Google Cloud Registry - run: gcloud --quiet auth configure-docker - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.5.0 - - name: Setup SSH key - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }} - - name: Run tests - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} name: prerelease on: diff --git a/provider-ci/test-providers/docker/.github/workflows/release.yml b/provider-ci/test-providers/docker/.github/workflows/release.yml index 61524bd6f..afe0bbcc1 100644 --- a/provider-ci/test-providers/docker/.github/workflows/release.yml +++ b/provider-ci/test-providers/docker/.github/workflows/release.yml @@ -88,85 +88,11 @@ jobs: isPrerelease: false test: - name: test + uses: ./.github/workflows/test.yml needs: - prerequisites - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - persist-credentials: false - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, ${{ matrix.language }} - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - run: |- - pip3 install virtualenv==20.0.23 - pip3 install pipenv - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 7200 - role-session-name: docker@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f # v2.1.7 - with: - service_account: ${{ env.GOOGLE_CI_SERVICE_ACCOUNT_EMAIL }} - workload_identity_provider: projects/${{ env.GOOGLE_PROJECT_NUMBER - }}/locations/global/workloadIdentityPools/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_POOL }}/providers/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER }} - - name: Setup gcloud auth - uses: google-github-actions/setup-gcloud@6189d56e4096ee891640bb02ac264be376592d6a # v2.1.2 - with: - install_components: gke-gcloud-auth-plugin - - name: Login to Google Cloud Registry - run: gcloud --quiet auth configure-docker - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.5.0 - - name: Setup SSH key - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }} - - name: Run tests - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} diff --git a/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml b/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml index 13d4529d4..2c8e52fdd 100644 --- a/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml +++ b/provider-ci/test-providers/docker/.github/workflows/run-acceptance-tests.yml @@ -128,102 +128,17 @@ jobs: sha: ${{ github.event.pull_request.head.sha || github.sha }} test: + # Don't run tests on PRs from forks. if: github.event_name == 'repository_dispatch' || - github.event.pull_request.head.repo.full_name == github.repository - name: test + github.event.pull_request.head.repo.full_name == github.repository + uses: ./.github/workflows/test.yml needs: - prerequisites - - build_provider - build_sdk - permissions: - contents: read - id-token: write - runs-on: ubuntu-latest - env: - PROVIDER_VERSION: ${{ needs.prerequisites.outputs.version }} - steps: - - name: Checkout Repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - ref: ${{ env.PR_COMMIT_SHA }} - persist-credentials: false - - name: Checkout p/examples - if: matrix.testTarget == 'pulumiExamples' - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - repository: pulumi/examples - path: p-examples - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, ${{ matrix.language }} - - name: Prepare local workspace - run: make prepare_local_workspace - - name: Download bin - uses: ./.github/actions/download-bin - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ matrix.language }} - - name: Restore makefile progress - run: make --touch provider schema build_${{ matrix.language }} - - name: Update path - run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - - name: Install Python deps - if: matrix.language == 'python' - run: |- - pip3 install virtualenv==20.0.23 - pip3 install pipenv - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-region: ${{ env.AWS_REGION }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - role-duration-seconds: 7200 - role-session-name: docker@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f # v2.1.7 - with: - service_account: ${{ env.GOOGLE_CI_SERVICE_ACCOUNT_EMAIL }} - workload_identity_provider: projects/${{ env.GOOGLE_PROJECT_NUMBER - }}/locations/global/workloadIdentityPools/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_POOL }}/providers/${{ - env.GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER }} - - name: Setup gcloud auth - uses: google-github-actions/setup-gcloud@6189d56e4096ee891640bb02ac264be376592d6a # v2.1.2 - with: - install_components: gke-gcloud-auth-plugin - - name: Login to Google Cloud Registry - run: gcloud --quiet auth configure-docker - - name: Install dependencies - run: make install_${{ matrix.language}}_sdk - - name: Install gotestfmt - uses: GoTestTools/gotestfmt-action@v2 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: v2.5.0 - - name: Setup SSH key - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }} - - name: Run tests - if: matrix.testTarget == 'local' - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . - - name: Run pulumi/examples tests - if: matrix.testTarget == 'pulumiExamples' - run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -run TestPulumiExamples -parallel 4 . - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - testTarget: [local] + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + license_check: name: License Check uses: ./.github/workflows/license.yml diff --git a/provider-ci/test-providers/docker/.github/workflows/test.yml b/provider-ci/test-providers/docker/.github/workflows/test.yml new file mode 100644 index 000000000..c0edf52cc --- /dev/null +++ b/provider-ci/test-providers/docker/.github/workflows/test.yml @@ -0,0 +1,135 @@ +name: "Test Provider" + +on: + workflow_call: + inputs: + version: + required: true + type: string + description: Version of the provider to test + +env: + PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} + ARM_CLIENT_ID: 30e520fa-12b4-4e21-b473-9426c5ac2e1e + ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }} + ARM_SUBSCRIPTION_ID: 0282681f-7a9e-424b-80b2-96babd57a8a1 + ARM_TENANT_ID: 706143bc-e1d4-4593-aee2-c9dc60ab9be7 + AWS_REGION: us-west-2 + AZURE_LOCATION: westus + DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }} + DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GOOGLE_CI_SERVICE_ACCOUNT_EMAIL: pulumi-ci@pulumi-ci-gcp-provider.iam.gserviceaccount.com + GOOGLE_CI_WORKLOAD_IDENTITY_POOL: pulumi-ci + GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER: pulumi-ci + GOOGLE_PROJECT: pulumi-ci-gcp-provider + GOOGLE_PROJECT_NUMBER: "895284651812" + GOOGLE_REGION: us-central1 + GOOGLE_ZONE: us-central1-a + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + 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 + PYPI_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + PYPI_USERNAME: __token__ + SIGNING_KEY: ${{ secrets.JAVA_SIGNING_KEY }} + SIGNING_KEY_ID: ${{ secrets.JAVA_SIGNING_KEY_ID }} + SIGNING_PASSWORD: ${{ secrets.JAVA_SIGNING_PASSWORD }} + TF_APPEND_USER_AGENT: pulumi + +jobs: + test: + permissions: + contents: read + id-token: write + runs-on: ubuntu-latest + env: + PROVIDER_VERSION: ${{ inputs.version }} + steps: + - name: Checkout Repo + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ env.PR_COMMIT_SHA }} + persist-credentials: false + - name: Checkout p/examples + if: matrix.testTarget == 'pulumiExamples' + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + repository: pulumi/examples + path: p-examples + - name: Setup tools + uses: ./.github/actions/setup-tools + with: + tools: pulumictl, pulumicli, ${{ matrix.language }} + - name: Prepare local workspace + run: make prepare_local_workspace + - name: Download bin + uses: ./.github/actions/download-bin + - name: Download SDK + uses: ./.github/actions/download-sdk + with: + language: ${{ matrix.language }} + - name: Restore makefile progress + run: make --touch provider schema build_${{ matrix.language }} + - name: Update path + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + - name: Install Python deps + if: matrix.language == 'python' + run: |- + pip3 install virtualenv==20.0.23 + pip3 install pipenv + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-region: ${{ env.AWS_REGION }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + role-duration-seconds: 7200 + role-session-name: docker@githubActions + role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} + - name: Authenticate to Google Cloud + uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f # v2.1.7 + with: + service_account: ${{ env.GOOGLE_CI_SERVICE_ACCOUNT_EMAIL }} + workload_identity_provider: projects/${{ env.GOOGLE_PROJECT_NUMBER + }}/locations/global/workloadIdentityPools/${{ + env.GOOGLE_CI_WORKLOAD_IDENTITY_POOL }}/providers/${{ + env.GOOGLE_CI_WORKLOAD_IDENTITY_PROVIDER }} + - name: Setup gcloud auth + uses: google-github-actions/setup-gcloud@6189d56e4096ee891640bb02ac264be376592d6a # v2.1.2 + with: + install_components: gke-gcloud-auth-plugin + - name: Login to Google Cloud Registry + run: gcloud --quiet auth configure-docker + - name: Install dependencies + run: make install_${{ matrix.language}}_sdk + - name: Install gotestfmt + uses: GoTestTools/gotestfmt-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: v2.5.0 + - name: Setup SSH key + uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: ${{ secrets.PRIVATE_SSH_KEY_FOR_DIGITALOCEAN }} + - name: Run tests + if: matrix.testTarget == 'local' + run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . + - name: Run pulumi/examples tests + if: matrix.testTarget == 'pulumiExamples' + run: cd examples && go test -v -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -run TestPulumiExamples -parallel 4 . + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + testTarget: [local]