-
Notifications
You must be signed in to change notification settings - Fork 8
Fix /run-acceptance-tests for bridged providers
#1793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,9 +9,9 @@ on: | |
| repository_dispatch: | ||
| types: | ||
| - run-acceptance-tests-command | ||
| workflow_dispatch: {} | ||
|
|
||
| env: | ||
| PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} | ||
| #{{ .Config | renderGlobalEnv | indent 2 }}# | ||
|
|
||
| # This should cancel any previous runs of the same workflow on the same branch which are still running. | ||
|
|
@@ -27,9 +27,11 @@ jobs: | |
| contents: read | ||
| pull-requests: write | ||
| id-token: write # For ESC secrets. | ||
| checks: write # For community PRs. | ||
| uses: ./.github/workflows/prerequisites.yml | ||
| secrets: inherit | ||
| with: | ||
| sha: ${{ github.event.client_payload.pull_request.merge_commit_sha }} | ||
| default_branch: ${{ github.event.pull_request.base.ref }} | ||
| is_pr: ${{ github.event_name == 'pull_request' }} | ||
| is_automated: ${{ github.actor == 'dependabot[bot]' }} | ||
|
|
@@ -42,6 +44,7 @@ jobs: | |
| contents: read | ||
| id-token: write # For ESC secrets. | ||
| with: | ||
| sha: ${{ github.event.client_payload.pull_request.merge_commit_sha }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Earlier we have: It is intentional that the checkout use the merge commit rather than the head commit? |
||
| version: ${{ needs.prerequisites.outputs.version }} | ||
| matrix: | | ||
| { | ||
|
|
@@ -63,6 +66,7 @@ jobs: | |
| contents: write # For Renovate SDKs. | ||
| id-token: write # For ESC secrets. | ||
| with: | ||
| sha: ${{ github.event.client_payload.pull_request.merge_commit_sha }} | ||
| version: ${{ needs.prerequisites.outputs.version }} | ||
| #{{- end }}# | ||
|
|
||
|
|
@@ -94,6 +98,8 @@ jobs: | |
| name: lint | ||
| uses: ./.github/workflows/lint.yml | ||
| secrets: inherit | ||
| with: | ||
| sha: ${{ github.event.client_payload.pull_request.merge_commit_sha }} | ||
| #{{ end -}}# | ||
|
|
||
| sentinel: | ||
|
|
@@ -123,6 +129,52 @@ jobs: | |
| # otherwise use the current SHA for any other type of build. | ||
| sha: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
|
||
| start-community-pr: | ||
| if: github.event_name == 'repository_dispatch' | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| check_id: ${{ steps.create_check.outputs.check_id }} | ||
| permissions: | ||
| checks: write | ||
| steps: | ||
| - name: Create pending check run for community PR | ||
| id: create_check | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| const { data: check } = await github.rest.checks.create({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| name: "Sentinel", | ||
| head_sha: "${{ github.event.client_payload.pull_request.merge_commit_sha }}", | ||
| status: "in_progress", | ||
| details_url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
| }); | ||
| core.setOutput("check_id", check.id); | ||
|
|
||
| finish-community-pr: | ||
| permissions: | ||
| checks: write | ||
| runs-on: ubuntu-latest | ||
| needs: | ||
| - start-community-pr | ||
| - sentinel | ||
| steps: | ||
| - name: Report success on community PR | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| await github.rest.checks.update({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| check_run_id: ${{ needs.start-community-pr.outputs.check_id }}, | ||
| conclusion: "success", | ||
| status: "completed", | ||
| completed_at: new Date().toISOString(), | ||
| }); | ||
|
|
||
| test: | ||
| # Don't run tests on PRs from forks. | ||
| if: github.event_name == 'repository_dispatch' || | ||
|
|
@@ -139,9 +191,12 @@ jobs: | |
| id-token: write | ||
| secrets: inherit | ||
| with: | ||
| sha: ${{ github.event.client_payload.pull_request.merge_commit_sha }} | ||
| version: ${{ needs.prerequisites.outputs.version }} | ||
|
|
||
| license_check: | ||
| name: License Check | ||
| uses: ./.github/workflows/license.yml | ||
| secrets: inherit | ||
| with: | ||
| sha: ${{ github.event.client_payload.pull_request.merge_commit_sha }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,15 +5,15 @@ name: "Test Provider" | |
| on: | ||
| workflow_call: | ||
| inputs: | ||
| sha: | ||
| type: string | ||
| description: The commit to build, primarily for community PRs. | ||
| version: | ||
| required: true | ||
| type: string | ||
| description: Version of the provider to test | ||
|
|
||
| env: | ||
| PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }} | ||
| MISE_ENV: test | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the impact of removing |
||
|
|
||
| #{{ .Config | renderGlobalEnv | indent 2 }}# | ||
|
|
||
| jobs: | ||
|
|
@@ -37,7 +37,7 @@ jobs: | |
| - name: Checkout Repo | ||
| uses: #{{ .Config.ActionVersions.Checkout }}# | ||
| with: | ||
| ref: ${{ env.PR_COMMIT_SHA }} | ||
| ref: ${{ inputs.sha }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a bit concerned that the ref is changing from head to merge commit. |
||
| #{{- if .Config.CheckoutSubmodules }}# | ||
| submodules: #{{ .Config.CheckoutSubmodules }}# | ||
| #{{- end }}# | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,12 @@ | ||
| # WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt | ||
|
|
||
| name: command-dispatch | ||
| on: | ||
| issue_comment: | ||
| types: | ||
| - created | ||
| - edited | ||
|
|
||
| env: | ||
| #{{ .Config | renderGlobalEnv | indent 2 }}# | ||
|
|
||
|
|
@@ -9,6 +16,7 @@ jobs: | |
| runs-on: #{{ .Config.Runner.Default }}# | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write # For comment reactions. | ||
| id-token: write # For ESC secrets. | ||
| steps: | ||
| - name: Checkout Repo | ||
|
|
@@ -23,15 +31,8 @@ jobs: | |
| with: | ||
| commands: | | ||
| run-acceptance-tests | ||
| release | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Explanation for why |
||
| issue-type: pull-request | ||
| permission: write | ||
| reaction-token: ${{ secrets.GITHUB_TOKEN }} | ||
| repository: #{{ .Repository }}# | ||
| token: ${{ steps.esc-secrets.outputs.PULUMI_BOT_TOKEN }} | ||
| name: command-dispatch | ||
| on: | ||
| issue_comment: | ||
| types: | ||
| - created | ||
| - edited | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be nice to clarify the default behavior.