diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/actions/test-setup/action.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/actions/test-setup/action.yml new file mode 100644 index 000000000..bfce7c923 --- /dev/null +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/actions/test-setup/action.yml @@ -0,0 +1,108 @@ +name: "Test Setup" +description: Sets up repository, tools and SDK ready for running integration tests + +inputs: + language: + required: true + description: The SDK language being used for tests + token: + required: false + description: Optional GH_TOKEN. + #{{- if .Config.aws }}# + aws-access-key-id: + required: false + description: e.g. secrets.AWS_ACCESS_KEY_ID + aws-region: + required: false + description: e.g. env.AWS_REGION + aws-secret-access-key: + required: false + description: e.g. secrets.AWS_SECRET_ACCESS_KEY + aws-role-to-assume: + required: false + description: e.g. secrets.AWS_CI_ROLE_ARN + #{{- end }}# + +runs: + using: "composite" + 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: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be + with: + tool-cache: false + swap-storage: false + #{{- end }}# + - name: Setup tools + uses: ./.github/actions/setup-tools + with: + tools: pulumictl, pulumicli, go, node, dotnet, python, java + - name: Download bin + uses: ./.github/actions/download-bin + - name: Add local nuget source + run: dotnet nuget add source ${{ github.workspace }}/nuget + shell: bash + - name: Download SDK + uses: ./.github/actions/download-sdk + with: + language: ${{ inputs.language }} + - name: Update path + shell: bash + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + - name: Install Python deps + shell: bash + run: |- + pip3 install virtualenv==20.0.23 + pip3 install pipenv + #{{- if .Config.docker }}# + - name: Run docker compose + shell: bash + 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: ${{ inputs.aws-access-key-id }} + aws-region: ${{ inputs.aws-region }} + aws-secret-access-key: ${{ inputs.aws-secret-access-key }} + role-duration-seconds: 7200 + role-session-name: #{{ .Config.provider }}#@githubActions + role-to-assume: ${{ inputs.role-to-assume }} + #{{- 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 + shell: bash + run: gcloud --quiet auth configure-docker + #{{- end }}# + #{{- if index .Config "setup-script" }}# + - name: Run setup script + shell: bash + run: #{{ index .Config "setup-script" }}# + #{{- end }}# + - name: Install dependencies + shell: bash + run: make install_${{ matrix.language}}_sdk + - name: Prepare upstream code + shell: bash + run: make upstream + - name: Install gotestfmt + uses: GoTestTools/gotestfmt-action@v2 + with: + token: ${{ inputs.token }} + version: v2.5.0 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 400b87353..93c229502 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 @@ -26,6 +26,16 @@ jobs: with: version: ${{ needs.prerequisites.outputs.version }} + test: + name: Test + needs: + - prerequisites + - build_sdk + uses: ./.github/workflows/test.yml + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + generate_coverage_data: continue-on-error: true env: @@ -114,119 +124,6 @@ jobs: RELEASE_BOT_KEY: ${{ secrets.RELEASE_BOT_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - test: - name: test - needs: - - prerequisites - - 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: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be - with: - tool-cache: false - swap-storage: false -#{{- end }}# - - name: Checkout Repo - uses: #{{ .Config.actionVersions.checkout }}# -#{{- if .Config.checkoutSubmodules }}# - with: - submodules: #{{ .Config.checkoutSubmodules }}# -#{{- end }}# - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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 - #{{- 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 .Config.sshPrivateKey }}# - - name: Setup SSH key - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: #{{ .Config.sshPrivateKey }}# - #{{- end }}# - #{{- if .Config.integrationTestProvider }}# - - name: Prepare upstream code - run: make upstream - #{{- end }}# - #{{- if index .Config "setup-script" }}# - - name: Run setup script - run: #{{ index .Config "setup-script" }}# - #{{- 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.integrationTestProvider }}# - - name: Run provider tests - working-directory: provider - run: go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - #{{- end }}# - - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java #{{- if .Config.extraTests }}# #{{ .Config.extraTests | toYaml | indent 2 }}# #{{ end }}# 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 1b7ba2f2a..e31bd485e 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,120 +28,15 @@ jobs: version: ${{ needs.prerequisites.outputs.version }} test: - name: test - needs: + name: Test + needs: - prerequisites - 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: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be - with: - tool-cache: false - swap-storage: false -#{{- end }}# - - name: Checkout Repo - uses: #{{ .Config.actionVersions.checkout }}# -#{{- if .Config.checkoutSubmodules }}# - with: - submodules: #{{ .Config.checkoutSubmodules }}# -#{{- end }}# - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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 - #{{- 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 .Config.sshPrivateKey }}# - - name: Setup SSH key - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: #{{ .Config.sshPrivateKey }}# - #{{- end }}# - #{{- if .Config.integrationTestProvider }}# - - name: Prepare upstream code - run: make upstream - #{{- end }}# - #{{- if index .Config "setup-script" }}# - - name: Run setup script - run: #{{ index .Config "setup-script" }}# - #{{- 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.integrationTestProvider }}# - - name: Run provider tests - if: matrix.testTarget == 'local' - working-directory: provider - run: go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - #{{- end }}# - - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java + uses: ./.github/workflows/test.yml + 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 4c223f57f..3f3c430ae 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 @@ -27,6 +27,16 @@ jobs: with: version: ${{ needs.prerequisites.outputs.version }} + test: + name: Test + needs: + - prerequisites + - build_sdk + uses: ./.github/workflows/test.yml + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + #{{ if .Config.lint -}}# lint: name: lint @@ -55,119 +65,6 @@ jobs: version: ${{ needs.prerequisites.outputs.version }} isPrerelease: true - test: - name: test - needs: - - prerequisites - - 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: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be - with: - tool-cache: false - swap-storage: false -#{{- end }}# - - name: Checkout Repo - uses: #{{ .Config.actionVersions.checkout }}# -#{{- if .Config.checkoutSubmodules }}# - with: - submodules: #{{ .Config.checkoutSubmodules }}# -#{{- end }}# - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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 - #{{- 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 .Config.sshPrivateKey }}# - - name: Setup SSH key - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: #{{ .Config.sshPrivateKey }}# - #{{- end }}# - #{{- if .Config.integrationTestProvider }}# - - name: Prepare upstream code - run: make upstream - #{{- end }}# - #{{- if index .Config "setup-script" }}# - - name: Run setup script - run: #{{ index .Config "setup-script" }}# - #{{- 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.integrationTestProvider }}# - - name: Run provider tests - working-directory: provider - run: go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - #{{- end }}# - - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java #{{- if .Config.extraTests }}# #{{ .Config.extraTests | toYaml | indent 2 }}# #{{ end }}# 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 1f5cbdd05..c0768dc9e 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 @@ -26,6 +26,16 @@ jobs: with: version: ${{ needs.prerequisites.outputs.version }} + test: + name: Test + needs: + - prerequisites + - build_sdk + uses: ./.github/workflows/test.yml + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + #{{ if .Config.lint -}}# lint: name: lint @@ -54,119 +64,6 @@ jobs: version: ${{ needs.prerequisites.outputs.version }} isPrerelease: false - test: - name: test - needs: - - prerequisites - - 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: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be - with: - tool-cache: false - swap-storage: false -#{{- end }}# - - name: Checkout Repo - uses: #{{ .Config.actionVersions.checkout }}# -#{{- if .Config.checkoutSubmodules }}# - with: - submodules: #{{ .Config.checkoutSubmodules }}# -#{{- end }}# - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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 - #{{- 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 .Config.sshPrivateKey }}# - - name: Setup SSH key - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: #{{ .Config.sshPrivateKey }}# - #{{- end }}# - #{{- if .Config.integrationTestProvider }}# - - name: Prepare upstream code - run: make upstream - #{{- end }}# - #{{- if index .Config "setup-script" }}# - - name: Run setup script - run: #{{ index .Config "setup-script" }}# - #{{- 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.integrationTestProvider }}# - - name: Run provider tests - working-directory: provider - run: go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - #{{- end }}# - - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java #{{- if .Config.extraTests }}# #{{ .Config.extraTests | toYaml | indent 2 }}# #{{ end }}# 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 fd7687ea1..ff86623d8 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 @@ -60,6 +60,32 @@ jobs: secrets: inherit #{{ end -}}# + test: + if: github.event_name == 'repository_dispatch' || + github.event.pull_request.head.repo.full_name == github.repository + name: Test + needs: + - prerequisites + - build_sdk + uses: ./.github/workflows/test.yml + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + + #{{- if .Config.testPulumiExamples }}# + test_examples: + if: github.event_name == 'repository_dispatch' || + github.event.pull_request.head.repo.full_name == github.repository + name: Test p/examples + needs: + - prerequisites + - build_sdk + uses: ./.github/workflows/test-examples.yml + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + #{{- end }}# + sentinel: name: sentinel if: github.event_name == 'repository_dispatch' || @@ -88,146 +114,15 @@ jobs: # otherwise use the current SHA for any other type of build. sha: ${{ github.event.pull_request.head.sha || github.sha }} - test: - if: github.event_name == 'repository_dispatch' || - github.event.pull_request.head.repo.full_name == github.repository - name: test - needs: - - prerequisites - - 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: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be - with: - tool-cache: false - swap-storage: false -#{{- end }}# - - name: Checkout Repo - uses: #{{ .Config.actionVersions.checkout }}# - with: - ref: ${{ env.PR_COMMIT_SHA }} - #{{- if .Config.checkoutSubmodules }}# - submodules: #{{ .Config.checkoutSubmodules }}# - #{{- end }}# - - 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, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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 - #{{- 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 .Config.sshPrivateKey }}# - - name: Setup SSH key - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: #{{ .Config.sshPrivateKey }}# - #{{- end }}# - #{{- if .Config.integrationTestProvider }}# - - name: Prepare upstream code - run: make upstream - #{{- end }}# - #{{- if index .Config "setup-script" }}# - - name: Run setup script - run: #{{ index .Config "setup-script" }}# - #{{- 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.integrationTestProvider }}# - - name: Run provider tests - if: matrix.testTarget == 'local' - working-directory: provider - run: go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - #{{- end }}# - - name: Run tests - if: matrix.testTarget == 'local' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - name: Run pulumi/examples tests - if: matrix.testTarget == 'pulumiExamples' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -run TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - #{{- if .Config.testPulumiExamples }}# - testTarget: [local, pulumiExamples] - #{{- else }}# - testTarget: [local] - #{{- end }}# license_check: name: License Check uses: ./.github/workflows/license.yml secrets: inherit + #{{- if .Config.extraTests }}# #{{ .Config.extraTests | toYaml | indent 2 }}# #{{ end }}# + name: run-acceptance-tests on: pull_request: diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/test-examples.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/test-examples.yml new file mode 100644 index 000000000..b6e5e8a87 --- /dev/null +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/test-examples.yml @@ -0,0 +1,58 @@ +name: "Test Examples" + +on: + workflow_call: + inputs: + version: + description: "The version of the provider to test" + required: true + type: string + +env: +#{{ .Config.env | toYaml | indent 2 }}# + +jobs: + test_examples: + name: Test p/examples + permissions: + contents: read + id-token: write + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + runs-on: #{{ if .Config.runner.buildSdk }}##{{- .Config.runner.buildSdk }}##{{ else }}##{{- .Config.runner.default }}##{{ end }}# + env: + PROVIDER_VERSION: ${{ inputs.version }} + steps: + - name: Checkout Repo + uses: #{{ .Config.actionVersions.checkout }}# + #{{- if .Config.checkoutSubmodules }}# + with: + submodules: #{{ .Config.checkoutSubmodules }}# + #{{- end }}# + - name: Test setup + uses: ./.github/actions/test-setup + with: + language: ${{ matrix.language }} + token: ${{ secrets.GITHUB_TOKEN }} + #{{- if .Config.aws }}# + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-region: ${{ env.AWS_REGION }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} + #{{- end }}# + - name: Checkout p/examples + uses: #{{ .Config.actionVersions.checkout }}# + with: + repository: pulumi/examples + path: p-examples + - name: Run pulumi/examples tests + run: + cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ + matrix.language }} -run TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt 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..1f8522110 --- /dev/null +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/test.yml @@ -0,0 +1,53 @@ +name: "Test" + +on: + workflow_call: + inputs: + version: + description: "The version of the provider to test" + required: true + type: string + +env: +#{{ .Config.env | toYaml | indent 2 }}# + +jobs: + test: + name: Test + permissions: + contents: read + id-token: write + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + runs-on: #{{ if .Config.runner.buildSdk }}##{{- .Config.runner.buildSdk }}##{{ else }}##{{- .Config.runner.default }}##{{ end }}# + env: + PROVIDER_VERSION: ${{ inputs.version }} + steps: + - name: Checkout Repo + uses: #{{ .Config.actionVersions.checkout }}# + #{{- if .Config.checkoutSubmodules }}# + with: + submodules: #{{ .Config.checkoutSubmodules }}# + #{{- end }}# + - name: Test setup + uses: ./.github/actions/test-setup + with: + language: ${{ matrix.language }} + token: ${{ secrets.GITHUB_TOKEN }} + #{{- if .Config.aws }}# + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-region: ${{ env.AWS_REGION }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} + #{{- end }}# + - name: Run tests + run: + cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ + matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt diff --git a/provider-ci/test-providers/aws/.github/actions/test-setup/action.yml b/provider-ci/test-providers/aws/.github/actions/test-setup/action.yml new file mode 100644 index 000000000..9ae2e27dc --- /dev/null +++ b/provider-ci/test-providers/aws/.github/actions/test-setup/action.yml @@ -0,0 +1,52 @@ +name: "Test Setup" +description: Sets up repository, tools and SDK ready for running integration tests + +inputs: + language: + required: true + description: The SDK language being used for tests + token: + required: false + description: Optional GH_TOKEN. + +runs: + using: "composite" + 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 + with: + tool-cache: false + swap-storage: false + - name: Setup tools + uses: ./.github/actions/setup-tools + with: + tools: pulumictl, pulumicli, go, node, dotnet, python, java + - name: Download bin + uses: ./.github/actions/download-bin + - name: Add local nuget source + run: dotnet nuget add source ${{ github.workspace }}/nuget + shell: bash + - name: Download SDK + uses: ./.github/actions/download-sdk + with: + language: ${{ inputs.language }} + - name: Update path + shell: bash + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + - name: Install Python deps + shell: bash + run: |- + pip3 install virtualenv==20.0.23 + pip3 install pipenv + - name: Install dependencies + shell: bash + run: make install_${{ matrix.language}}_sdk + - name: Prepare upstream code + shell: bash + run: make upstream + - name: Install gotestfmt + uses: GoTestTools/gotestfmt-action@v2 + with: + token: ${{ inputs.token }} + version: v2.5.0 diff --git a/provider-ci/test-providers/aws/.github/workflows/master.yml b/provider-ci/test-providers/aws/.github/workflows/master.yml index 0a2da02ec..8709977bb 100644 --- a/provider-ci/test-providers/aws/.github/workflows/master.yml +++ b/provider-ci/test-providers/aws/.github/workflows/master.yml @@ -44,6 +44,16 @@ jobs: with: version: ${{ needs.prerequisites.outputs.version }} + test: + name: Test + needs: + - prerequisites + - build_sdk + uses: ./.github/workflows/test.yml + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + generate_coverage_data: continue-on-error: true env: @@ -122,75 +132,6 @@ jobs: RELEASE_BOT_ENDPOINT: ${{ secrets.RELEASE_BOT_ENDPOINT }} RELEASE_BOT_KEY: ${{ secrets.RELEASE_BOT_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - test: - name: test - needs: - - prerequisites - - 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 - with: - tool-cache: false - swap-storage: false - - name: Checkout Repo - uses: actions/checkout@v4 - with: - submodules: true - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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: Make upstream - run: make upstream - - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java go_test_shim: name: Run test of provider shim runs-on: ubuntu-latest 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 1d8684f30..1c5e8dd94 100644 --- a/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml +++ b/provider-ci/test-providers/aws/.github/workflows/nightly-test.yml @@ -45,74 +45,15 @@ jobs: version: ${{ needs.prerequisites.outputs.version }} test: - name: test - needs: + name: Test + needs: - prerequisites - 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 - with: - tool-cache: false - swap-storage: false - - name: Checkout Repo - uses: actions/checkout@v4 - with: - submodules: true - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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: Make upstream - run: make upstream - - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java + uses: ./.github/workflows/test.yml + 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 68db8a196..75d7fc76e 100644 --- a/provider-ci/test-providers/aws/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/aws/.github/workflows/prerelease.yml @@ -45,6 +45,16 @@ jobs: with: version: ${{ needs.prerequisites.outputs.version }} + test: + name: Test + needs: + - prerequisites + - build_sdk + uses: ./.github/workflows/test.yml + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + license_check: name: License Check uses: ./.github/workflows/license.yml @@ -65,75 +75,6 @@ jobs: with: version: ${{ needs.prerequisites.outputs.version }} isPrerelease: true - - test: - name: test - needs: - - prerequisites - - 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 - with: - tool-cache: false - swap-storage: false - - name: Checkout Repo - uses: actions/checkout@v4 - with: - submodules: true - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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: Make upstream - run: make upstream - - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java go_test_shim: name: Run test of provider shim runs-on: ubuntu-latest diff --git a/provider-ci/test-providers/aws/.github/workflows/release.yml b/provider-ci/test-providers/aws/.github/workflows/release.yml index 0e6b066a4..e42e4a27d 100644 --- a/provider-ci/test-providers/aws/.github/workflows/release.yml +++ b/provider-ci/test-providers/aws/.github/workflows/release.yml @@ -44,6 +44,16 @@ jobs: with: version: ${{ needs.prerequisites.outputs.version }} + test: + name: Test + needs: + - prerequisites + - build_sdk + uses: ./.github/workflows/test.yml + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + license_check: name: License Check uses: ./.github/workflows/license.yml @@ -64,75 +74,6 @@ jobs: with: version: ${{ needs.prerequisites.outputs.version }} isPrerelease: false - - test: - name: test - needs: - - prerequisites - - 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 - with: - tool-cache: false - swap-storage: false - - name: Checkout Repo - uses: actions/checkout@v4 - with: - submodules: true - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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: Make upstream - run: make upstream - - name: Run tests - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java go_test_shim: name: Run test of provider shim runs-on: ubuntu-latest 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 3ef166166..bdc389d86 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 @@ -69,6 +69,18 @@ jobs: issue-number: ${{ github.event.client_payload.github.payload.issue.number }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} token: ${{ secrets.PULUMI_BOT_TOKEN }} + test: + if: github.event_name == 'repository_dispatch' || + github.event.pull_request.head.repo.full_name == github.repository + name: Test + needs: + - prerequisites + - build_sdk + uses: ./.github/workflows/test.yml + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + sentinel: name: sentinel if: github.event_name == 'repository_dispatch' || @@ -94,89 +106,6 @@ jobs: # otherwise use the current SHA for any other type of build. sha: ${{ github.event.pull_request.head.sha || github.sha }} - test: - if: github.event_name == 'repository_dispatch' || - github.event.pull_request.head.repo.full_name == github.repository - name: test - needs: - - prerequisites - - 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 - with: - tool-cache: false - swap-storage: false - - name: Checkout Repo - uses: actions/checkout@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - submodules: true - - name: Checkout p/examples - if: matrix.testTarget == 'pulumiExamples' - uses: actions/checkout@v4 - with: - repository: pulumi/examples - path: p-examples - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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: Make upstream - run: make upstream - - name: Run tests - if: matrix.testTarget == 'local' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - name: Run pulumi/examples tests - if: matrix.testTarget == 'pulumiExamples' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -run TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - testTarget: [local] license_check: name: License Check uses: ./.github/workflows/license.yml @@ -373,6 +302,7 @@ jobs: language: - nodejs + name: run-acceptance-tests on: pull_request: diff --git a/provider-ci/test-providers/aws/.github/workflows/test-examples.yml b/provider-ci/test-providers/aws/.github/workflows/test-examples.yml new file mode 100644 index 000000000..8d2a5be57 --- /dev/null +++ b/provider-ci/test-providers/aws/.github/workflows/test-examples.yml @@ -0,0 +1,68 @@ +name: "Test Examples" + +on: + workflow_call: + inputs: + version: + description: "The version of the provider to test" + required: true + type: string + +env: + 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_examples: + name: Test p/examples + permissions: + contents: read + id-token: write + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + runs-on: ubuntu-latest + env: + PROVIDER_VERSION: ${{ inputs.version }} + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + submodules: true + - name: Test setup + uses: ./.github/actions/test-setup + with: + language: ${{ matrix.language }} + token: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout p/examples + uses: actions/checkout@v4 + with: + repository: pulumi/examples + path: p-examples + - name: Run pulumi/examples tests + run: + cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ + matrix.language }} -run TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt 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..57213443f --- /dev/null +++ b/provider-ci/test-providers/aws/.github/workflows/test.yml @@ -0,0 +1,63 @@ +name: "Test" + +on: + workflow_call: + inputs: + version: + description: "The version of the provider to test" + required: true + type: string + +env: + 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: + name: Test + permissions: + contents: read + id-token: write + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + runs-on: ubuntu-latest + env: + PROVIDER_VERSION: ${{ inputs.version }} + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + submodules: true + - name: Test setup + uses: ./.github/actions/test-setup + with: + language: ${{ matrix.language }} + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run tests + run: + cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ + matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt diff --git a/provider-ci/test-providers/cloudflare/.github/actions/test-setup/action.yml b/provider-ci/test-providers/cloudflare/.github/actions/test-setup/action.yml new file mode 100644 index 000000000..37451ba4f --- /dev/null +++ b/provider-ci/test-providers/cloudflare/.github/actions/test-setup/action.yml @@ -0,0 +1,46 @@ +name: "Test Setup" +description: Sets up repository, tools and SDK ready for running integration tests + +inputs: + language: + required: true + description: The SDK language being used for tests + token: + required: false + description: Optional GH_TOKEN. + +runs: + using: "composite" + steps: + - name: Setup tools + uses: ./.github/actions/setup-tools + with: + tools: pulumictl, pulumicli, go, node, dotnet, python, java + - name: Download bin + uses: ./.github/actions/download-bin + - name: Add local nuget source + run: dotnet nuget add source ${{ github.workspace }}/nuget + shell: bash + - name: Download SDK + uses: ./.github/actions/download-sdk + with: + language: ${{ inputs.language }} + - name: Update path + shell: bash + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + - name: Install Python deps + shell: bash + run: |- + pip3 install virtualenv==20.0.23 + pip3 install pipenv + - name: Install dependencies + shell: bash + run: make install_${{ matrix.language}}_sdk + - name: Prepare upstream code + shell: bash + run: make upstream + - name: Install gotestfmt + uses: GoTestTools/gotestfmt-action@v2 + with: + token: ${{ inputs.token }} + version: v2.5.0 diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/master.yml b/provider-ci/test-providers/cloudflare/.github/workflows/master.yml index c89bd645b..6b7577525 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/master.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/master.yml @@ -43,6 +43,16 @@ jobs: with: version: ${{ needs.prerequisites.outputs.version }} + test: + name: Test + needs: + - prerequisites + - build_sdk + uses: ./.github/workflows/test.yml + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + generate_coverage_data: continue-on-error: true env: @@ -120,62 +130,6 @@ jobs: RELEASE_BOT_ENDPOINT: ${{ secrets.RELEASE_BOT_ENDPOINT }} RELEASE_BOT_KEY: ${{ secrets.RELEASE_BOT_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - test: - name: test - needs: - - prerequisites - - 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@v4 - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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: 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 -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java 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 657854b94..31af50fc1 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/prerelease.yml @@ -44,6 +44,16 @@ jobs: with: version: ${{ needs.prerequisites.outputs.version }} + test: + name: Test + needs: + - prerequisites + - build_sdk + uses: ./.github/workflows/test.yml + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + lint: name: lint uses: ./.github/workflows/lint.yml @@ -66,62 +76,6 @@ jobs: version: ${{ needs.prerequisites.outputs.version }} isPrerelease: true - test: - name: test - needs: - - prerequisites - - 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@v4 - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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: 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 -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - name: prerelease on: push: diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/release.yml b/provider-ci/test-providers/cloudflare/.github/workflows/release.yml index d68897f71..6c9026f82 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/release.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/release.yml @@ -43,6 +43,16 @@ jobs: with: version: ${{ needs.prerequisites.outputs.version }} + test: + name: Test + needs: + - prerequisites + - build_sdk + uses: ./.github/workflows/test.yml + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + lint: name: lint uses: ./.github/workflows/lint.yml @@ -65,62 +75,6 @@ jobs: version: ${{ needs.prerequisites.outputs.version }} isPrerelease: false - test: - name: test - needs: - - prerequisites - - 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@v4 - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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: 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 -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - name: release on: push: 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 e63ffa76a..460e8dbed 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 @@ -74,6 +74,18 @@ jobs: name: lint uses: ./.github/workflows/lint.yml secrets: inherit + test: + if: github.event_name == 'repository_dispatch' || + github.event.pull_request.head.repo.full_name == github.repository + name: Test + needs: + - prerequisites + - build_sdk + uses: ./.github/workflows/test.yml + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + sentinel: name: sentinel if: github.event_name == 'repository_dispatch' || @@ -97,81 +109,11 @@ jobs: # otherwise use the current SHA for any other type of build. sha: ${{ github.event.pull_request.head.sha || github.sha }} - test: - if: github.event_name == 'repository_dispatch' || - github.event.pull_request.head.repo.full_name == github.repository - name: test - needs: - - prerequisites - - 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@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - - name: Checkout p/examples - if: matrix.testTarget == 'pulumiExamples' - uses: actions/checkout@v4 - with: - repository: pulumi/examples - path: p-examples - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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: 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 -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - name: Run pulumi/examples tests - if: matrix.testTarget == 'pulumiExamples' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -run TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - testTarget: [local] license_check: name: License Check uses: ./.github/workflows/license.yml secrets: inherit + name: run-acceptance-tests on: pull_request: diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/test-examples.yml b/provider-ci/test-providers/cloudflare/.github/workflows/test-examples.yml new file mode 100644 index 000000000..1339451c2 --- /dev/null +++ b/provider-ci/test-providers/cloudflare/.github/workflows/test-examples.yml @@ -0,0 +1,65 @@ +name: "Test Examples" + +on: + workflow_call: + inputs: + version: + description: "The version of the provider to test" + required: true + type: string + +env: + 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_examples: + name: Test p/examples + permissions: + contents: read + id-token: write + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + runs-on: ubuntu-latest + env: + PROVIDER_VERSION: ${{ inputs.version }} + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Test setup + uses: ./.github/actions/test-setup + with: + language: ${{ matrix.language }} + token: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout p/examples + uses: actions/checkout@v4 + with: + repository: pulumi/examples + path: p-examples + - name: Run pulumi/examples tests + run: + cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ + matrix.language }} -run TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt 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..47acee385 --- /dev/null +++ b/provider-ci/test-providers/cloudflare/.github/workflows/test.yml @@ -0,0 +1,60 @@ +name: "Test" + +on: + workflow_call: + inputs: + version: + description: "The version of the provider to test" + required: true + type: string + +env: + 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: + name: Test + permissions: + contents: read + id-token: write + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + runs-on: ubuntu-latest + env: + PROVIDER_VERSION: ${{ inputs.version }} + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Test setup + uses: ./.github/actions/test-setup + with: + language: ${{ matrix.language }} + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run tests + run: + cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ + matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt diff --git a/provider-ci/test-providers/docker/.github/actions/test-setup/action.yml b/provider-ci/test-providers/docker/.github/actions/test-setup/action.yml new file mode 100644 index 000000000..f54c1994c --- /dev/null +++ b/provider-ci/test-providers/docker/.github/actions/test-setup/action.yml @@ -0,0 +1,82 @@ +name: "Test Setup" +description: Sets up repository, tools and SDK ready for running integration tests + +inputs: + language: + required: true + description: The SDK language being used for tests + token: + required: false + description: Optional GH_TOKEN. + aws-access-key-id: + required: false + description: e.g. secrets.AWS_ACCESS_KEY_ID + aws-region: + required: false + description: e.g. env.AWS_REGION + aws-secret-access-key: + required: false + description: e.g. secrets.AWS_SECRET_ACCESS_KEY + aws-role-to-assume: + required: false + description: e.g. secrets.AWS_CI_ROLE_ARN + +runs: + using: "composite" + steps: + - name: Setup tools + uses: ./.github/actions/setup-tools + with: + tools: pulumictl, pulumicli, go, node, dotnet, python, java + - name: Download bin + uses: ./.github/actions/download-bin + - name: Add local nuget source + run: dotnet nuget add source ${{ github.workspace }}/nuget + shell: bash + - name: Download SDK + uses: ./.github/actions/download-sdk + with: + language: ${{ inputs.language }} + - name: Update path + shell: bash + run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + - name: Install Python deps + shell: bash + run: |- + pip3 install virtualenv==20.0.23 + pip3 install pipenv + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ inputs.aws-access-key-id }} + aws-region: ${{ inputs.aws-region }} + aws-secret-access-key: ${{ inputs.aws-secret-access-key }} + role-duration-seconds: 7200 + role-session-name: docker@githubActions + role-to-assume: ${{ inputs.role-to-assume }} + - name: Authenticate to Google Cloud + uses: google-github-actions/auth@v2 + 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@v2 + with: + install_components: gke-gcloud-auth-plugin + - name: Login to Google Cloud Registry + shell: bash + run: gcloud --quiet auth configure-docker + - name: Install dependencies + shell: bash + run: make install_${{ matrix.language}}_sdk + - name: Prepare upstream code + shell: bash + run: make upstream + - name: Install gotestfmt + uses: GoTestTools/gotestfmt-action@v2 + with: + token: ${{ inputs.token }} + version: v2.5.0 diff --git a/provider-ci/test-providers/docker/.github/workflows/master.yml b/provider-ci/test-providers/docker/.github/workflows/master.yml index 34df5b99a..7d959af40 100644 --- a/provider-ci/test-providers/docker/.github/workflows/master.yml +++ b/provider-ci/test-providers/docker/.github/workflows/master.yml @@ -56,6 +56,16 @@ jobs: with: version: ${{ needs.prerequisites.outputs.version }} + test: + name: Test + needs: + - prerequisites + - build_sdk + uses: ./.github/workflows/test.yml + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + generate_coverage_data: continue-on-error: true env: @@ -133,83 +143,6 @@ jobs: RELEASE_BOT_ENDPOINT: ${{ secrets.RELEASE_BOT_ENDPOINT }} RELEASE_BOT_KEY: ${{ secrets.RELEASE_BOT_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - test: - name: test - needs: - - prerequisites - - 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@v4 - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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: 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: 7200 - role-session-name: docker@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v2 - 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@v2 - 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 -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java 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 e6c311d73..2dd3f654e 100644 --- a/provider-ci/test-providers/docker/.github/workflows/prerelease.yml +++ b/provider-ci/test-providers/docker/.github/workflows/prerelease.yml @@ -57,6 +57,16 @@ jobs: with: version: ${{ needs.prerequisites.outputs.version }} + test: + name: Test + needs: + - prerequisites + - build_sdk + uses: ./.github/workflows/test.yml + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + lint: name: lint uses: ./.github/workflows/lint.yml @@ -79,83 +89,6 @@ jobs: version: ${{ needs.prerequisites.outputs.version }} isPrerelease: true - test: - name: test - needs: - - prerequisites - - 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@v4 - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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: 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: 7200 - role-session-name: docker@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v2 - 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@v2 - 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 -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - name: prerelease on: push: diff --git a/provider-ci/test-providers/docker/.github/workflows/release.yml b/provider-ci/test-providers/docker/.github/workflows/release.yml index c16fc69be..fac298c4d 100644 --- a/provider-ci/test-providers/docker/.github/workflows/release.yml +++ b/provider-ci/test-providers/docker/.github/workflows/release.yml @@ -56,6 +56,16 @@ jobs: with: version: ${{ needs.prerequisites.outputs.version }} + test: + name: Test + needs: + - prerequisites + - build_sdk + uses: ./.github/workflows/test.yml + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + lint: name: lint uses: ./.github/workflows/lint.yml @@ -78,83 +88,6 @@ jobs: version: ${{ needs.prerequisites.outputs.version }} isPrerelease: false - test: - name: test - needs: - - prerequisites - - 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@v4 - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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: 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: 7200 - role-session-name: docker@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v2 - 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@v2 - 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 -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - name: release on: push: 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 22f4ab356..decc44912 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 @@ -87,6 +87,18 @@ jobs: name: lint uses: ./.github/workflows/lint.yml secrets: inherit + test: + if: github.event_name == 'repository_dispatch' || + github.event.pull_request.head.repo.full_name == github.repository + name: Test + needs: + - prerequisites + - build_sdk + uses: ./.github/workflows/test.yml + secrets: inherit + with: + version: ${{ needs.prerequisites.outputs.version }} + sentinel: name: sentinel if: github.event_name == 'repository_dispatch' || @@ -110,102 +122,11 @@ jobs: # otherwise use the current SHA for any other type of build. sha: ${{ github.event.pull_request.head.sha || github.sha }} - test: - if: github.event_name == 'repository_dispatch' || - github.event.pull_request.head.repo.full_name == github.repository - name: test - needs: - - prerequisites - - 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@v4 - with: - ref: ${{ env.PR_COMMIT_SHA }} - - name: Checkout p/examples - if: matrix.testTarget == 'pulumiExamples' - uses: actions/checkout@v4 - with: - repository: pulumi/examples - path: p-examples - - name: Setup tools - uses: ./.github/actions/setup-tools - with: - tools: pulumictl, pulumicli, go, node, dotnet, python, java - - name: Download bin - uses: ./.github/actions/download-bin - - run: dotnet nuget add source ${{ github.workspace }}/nuget - - name: Download SDK - uses: ./.github/actions/download-sdk - with: - language: ${{ 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: 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: 7200 - role-session-name: docker@githubActions - role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v2 - 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@v2 - 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 -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - - name: Run pulumi/examples tests - if: matrix.testTarget == 'pulumiExamples' - run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ - matrix.language }} -run TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - strategy: - fail-fast: false - matrix: - language: - - nodejs - - python - - dotnet - - go - - java - testTarget: [local] license_check: name: License Check uses: ./.github/workflows/license.yml secrets: inherit + name: run-acceptance-tests on: pull_request: diff --git a/provider-ci/test-providers/docker/.github/workflows/test-examples.yml b/provider-ci/test-providers/docker/.github/workflows/test-examples.yml new file mode 100644 index 000000000..18f7e7902 --- /dev/null +++ b/provider-ci/test-providers/docker/.github/workflows/test-examples.yml @@ -0,0 +1,82 @@ +name: "Test Examples" + +on: + workflow_call: + inputs: + version: + description: "The version of the provider to test" + required: true + type: string + +env: + 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_examples: + name: Test p/examples + permissions: + contents: read + id-token: write + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + runs-on: ubuntu-latest + env: + PROVIDER_VERSION: ${{ inputs.version }} + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Test setup + uses: ./.github/actions/test-setup + with: + language: ${{ matrix.language }} + token: ${{ secrets.GITHUB_TOKEN }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-region: ${{ env.AWS_REGION }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} + - name: Checkout p/examples + uses: actions/checkout@v4 + with: + repository: pulumi/examples + path: p-examples + - name: Run pulumi/examples tests + run: + cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ + matrix.language }} -run TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt 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..84e3c1743 --- /dev/null +++ b/provider-ci/test-providers/docker/.github/workflows/test.yml @@ -0,0 +1,77 @@ +name: "Test" + +on: + workflow_call: + inputs: + version: + description: "The version of the provider to test" + required: true + type: string + +env: + 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: + name: Test + permissions: + contents: read + id-token: write + strategy: + fail-fast: false + matrix: + language: + - nodejs + - python + - dotnet + - go + - java + runs-on: ubuntu-latest + env: + PROVIDER_VERSION: ${{ inputs.version }} + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + - name: Test setup + uses: ./.github/actions/test-setup + with: + language: ${{ matrix.language }} + token: ${{ secrets.GITHUB_TOKEN }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-region: ${{ env.AWS_REGION }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }} + - name: Run tests + run: + cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ + matrix.language }} -skip TestPulumiExamples -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt