11name : start-integration-tests
22
33on :
4- # schedule:
5- # - cron: '*/10 * * * *'
64 workflow_dispatch :
5+ merge_group :
76
87jobs :
9- # Trigger for pull requests.
10- #
8+ # Auto-approve integration tests for merge queue.
9+ # The tests already passed on the PR, so we don't need to run them again.
10+ auto-approve :
11+ if : github.event_name == 'merge_group'
12+
13+ runs-on :
14+ group : databricks-deco-testing-runner-group
15+ labels : ubuntu-latest-deco
16+
17+ permissions :
18+ checks : write
19+ contents : read
20+
21+ steps :
22+ - name : Auto-approve Check for Merge Queue
23+ uses : actions/github-script@v7
24+ with :
25+ script : |
26+ await github.rest.checks.create({
27+ owner: context.repo.owner,
28+ repo: context.repo.repo,
29+ name: 'Integration Tests',
30+ head_sha: context.sha,
31+ status: 'completed',
32+ conclusion: 'success',
33+ output: {
34+ title: 'Integration Tests',
35+ summary: 'Auto-approved for merge queue (tests already passed on PR)'
36+ }
37+ });
38+
39+ # Trigger integration tests for PRs.
1140 # This workflow triggers the integration test workflow in a different repository.
1241 # It requires secrets from the "test-trigger-is" environment, which are only available to authorized users.
1342 trigger :
43+ if : github.event_name == 'workflow_dispatch'
44+
1445 runs-on :
1546 group : databricks-deco-testing-runner-group
1647 labels : ubuntu-latest-deco
1748
1849 environment : " test-trigger-is"
1950
20- # Only run this job for PRs from branches on the main repository and not from forks.
21- # Workflows triggered by PRs from forks don't have access to the "test-trigger-is" environment.
22- if : " ${{ !github.event.pull_request.head.repo.fork }}"
23-
2451 steps :
25- - name : Generate GitHub App Token
52+ - name : Generate GitHub App Token for Workflow Trigger
2653 id : generate-token
2754 uses : actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
2855 with :
@@ -31,11 +58,20 @@ jobs:
3158 owner : ${{ secrets.ORG_NAME }}
3259 repositories : ${{secrets.REPO_NAME}}
3360
61+ - name : Generate GitHub App Token for Check Updates
62+ id : generate-check-token
63+ uses : actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
64+ with :
65+ app-id : ${{ secrets.DECO_TEST_APPROVAL_APP_ID }}
66+ private-key : ${{ secrets.DECO_TEST_APPROVAL_PRIVATE_KEY }}
67+ owner : databricks
68+
3469 - name : Fetch start_integration_tests.py
3570 run : wget https://raw.githubusercontent.com/databricks/cli/refs/heads/main/tools/start_integration_tests.py
3671
3772 - name : Run start_integration_tests.py
3873 env :
3974 GH_TOKEN : ${{ steps.generate-token.outputs.token }}
75+ GH_CHECK_TOKEN : ${{ steps.generate-check-token.outputs.token }}
4076 run : |-
4177 python3 ./start_integration_tests.py -R ${{ secrets.ORG_NAME }}/${{secrets.REPO_NAME}} --yes
0 commit comments