-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trigger integration tests on push to main
- Loading branch information
Showing
3 changed files
with
79 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: integration-approve | ||
|
||
on: | ||
merge_group: | ||
|
||
jobs: | ||
# Trigger for merge groups. | ||
# | ||
# Statuses and checks apply to specific commits (by hash). | ||
# Enforcement of required checks is done both at the PR level and the merge queue level. | ||
# In case of multiple commits in a single PR, the hash of the squashed commit | ||
# will not match the one for the latest (approved) commit in the PR. | ||
# | ||
# We auto approve the check for the merge queue for two reasons: | ||
# | ||
# * Queue times out due to duration of tests. | ||
# * Avoid running integration tests twice, since it was already run at the tip of the branch before squashing. | ||
# | ||
trigger: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Mark Check | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
shell: bash | ||
run: | | ||
gh api -X POST -H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
/repos/${{ github.repository }}/statuses/${{ github.sha }} \ | ||
-f 'state=success' \ | ||
-f 'context=Integration Tests Check' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: integration-main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
# Trigger for pushes to the main branch. | ||
# | ||
# This workflow triggers the integration test workflow in a different repository. | ||
# It requires secrets from the "test-trigger-is" environment, which are only available to authorized users. | ||
trigger: | ||
runs-on: ubuntu-latest | ||
environment: "test-trigger-is" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Generate GitHub App Token | ||
id: generate-token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ secrets.DECO_WORKFLOW_TRIGGER_APP_ID }} | ||
private-key: ${{ secrets.DECO_WORKFLOW_TRIGGER_PRIVATE_KEY }} | ||
owner: ${{ secrets.ORG_NAME }} | ||
repositories: ${{secrets.REPO_NAME}} | ||
|
||
- name: Trigger Workflow in Another Repo | ||
env: | ||
GH_TOKEN: ${{ steps.generate-token.outputs.token }} | ||
run: | | ||
gh workflow run cli-isolated-nightly.yml -R ${{ secrets.ORG_NAME }}/${{secrets.REPO_NAME}} \ | ||
--ref main \ | ||
-f commit_sha=${{ github.event.after }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters