Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 38 additions & 19 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ jobs:
group: databricks-deco-testing-runner-group
labels: ubuntu-latest-deco

permissions:
checks: write
contents: read

environment: "test-trigger-is"

steps:
Expand All @@ -394,29 +398,44 @@ jobs:
-f commit_sha=${{ github.event.pull_request.head.sha }}

# Skip integration tests if the primary "test" target is not triggered by this change.
# Use Checks API (not Statuses API) to match the required "Integration Tests" check.
- name: Skip integration tests (pull request)
if: ${{ github.event_name == 'pull_request' && !contains(fromJSON(needs.testmask.outputs.targets), 'test') }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |-
gh api -X POST -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha }} \
-f 'state=success' \
-f 'context=Integration Tests Check' \
-f 'description=⏭️ Skipped'

uses: actions/github-script@v7
with:
script: |
await github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Integration Tests',
head_sha: '${{ github.event.pull_request.head.sha }}',
status: 'completed',
conclusion: 'success',
output: {
title: 'Integration Tests',
summary: '⏭️ Skipped (changes do not require integration tests)'
}
});

# Auto-approve for merge group since tests already passed on the PR.
# Use Checks API (not Statuses API) to match the required "Integration Tests" check.
- name: Auto-approve for merge group
if: ${{ github.event_name == 'merge_group' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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' \
-f 'description=⏭️ Skipped'
uses: actions/github-script@v7
with:
script: |
await github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Integration Tests',
head_sha: context.sha,
status: 'completed',
conclusion: 'success',
output: {
title: 'Integration Tests',
summary: '⏭️ Auto-approved for merge queue (tests already passed on PR)'
}
});

- name: Trigger integration tests (push to main)
if: ${{ github.event_name == 'push' }}
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/start-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,12 @@ name: start-integration-tests

on:
workflow_dispatch:
merge_group:

jobs:
# Auto-approve integration tests for merge queue.
# The tests already passed on the PR, so we don't need to run them again.
auto-approve:
if: github.event_name == 'merge_group'

runs-on:
group: databricks-deco-testing-runner-group
labels: ubuntu-latest-deco

permissions:
checks: write
contents: read

steps:
- name: Auto-approve Check for Merge Queue
uses: actions/github-script@v7
with:
script: |
await github.rest.checks.create({
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Integration Tests',
head_sha: context.sha,
status: 'completed',
conclusion: 'success',
output: {
title: 'Integration Tests',
summary: 'Auto-approved for merge queue (tests already passed on PR)'
}
});

# Trigger integration tests for PRs.
# 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:
if: github.event_name == 'workflow_dispatch'

runs-on:
group: databricks-deco-testing-runner-group
Expand Down