Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions .github/workflows/dotnet-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ name: dotnet-build-and-test

on:
workflow_dispatch:
workflow_call:
inputs:
checkout-ref:
description: "Git ref to checkout (e.g., a commit SHA from a PR)"
required: false
type: string
default: ""
pull_request:
branches: ["main", "feature*"]
merge_group:
Expand Down Expand Up @@ -39,6 +46,8 @@ jobs:
cosmosDbChanges: ${{ steps.filter.outputs.cosmosdb }}
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.checkout-ref }}
- uses: dorny/paths-filter@v3
id: filter
with:
Expand Down Expand Up @@ -76,6 +85,7 @@ jobs:
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.checkout-ref }}
persist-credentials: false
sparse-checkout: |
.
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/integration-tests-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#
# This workflow allows manually running integration tests against an open PR.
# Go to Actions → "Integration Tests (Manual)" → Run workflow → enter the PR number.
#
# It reuses the existing dotnet-build-and-test and python-merge-tests workflows,
# passing the PR's head commit SHA so they check out and test the PR code.
#

name: Integration Tests (Manual)

on:
workflow_dispatch:
inputs:
pr-number:
description: "PR number to run integration tests against"
required: true
type: string

concurrency:
group: integration-tests-manual-pr-${{ github.event.inputs.pr-number }}
cancel-in-progress: true

jobs:
resolve-pr:
name: Resolve PR
runs-on: ubuntu-latest
outputs:
head-sha: ${{ steps.pr-info.outputs.head-sha }}
steps:
- name: Get PR info
id: pr-info
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_DATA=$(gh pr view ${{ github.event.inputs.pr-number }} --repo ${{ github.repository }} --json headRefOid,state)
PR_STATE=$(echo "$PR_DATA" | jq -r '.state')
HEAD_SHA=$(echo "$PR_DATA" | jq -r '.headRefOid')

if [ "$PR_STATE" != "OPEN" ]; then
echo "::error::PR #${{ github.event.inputs.pr-number }} is not open (state: $PR_STATE)"
exit 1
fi

echo "head-sha=$HEAD_SHA" >> "$GITHUB_OUTPUT"
echo "Running integration tests for PR #${{ github.event.inputs.pr-number }} at commit $HEAD_SHA"

dotnet-integration-tests:
name: .NET Integration Tests
needs: resolve-pr
uses: ./.github/workflows/dotnet-build-and-test.yml
with:
checkout-ref: ${{ needs.resolve-pr.outputs.head-sha }}
secrets: inherit

python-integration-tests:
name: Python Integration Tests
needs: resolve-pr
uses: ./.github/workflows/python-merge-tests.yml
with:
checkout-ref: ${{ needs.resolve-pr.outputs.head-sha }}
secrets: inherit
13 changes: 13 additions & 0 deletions .github/workflows/python-merge-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ name: Python - Merge - Tests

on:
workflow_dispatch:
workflow_call:
inputs:
checkout-ref:
description: "Git ref to checkout (e.g., a commit SHA from a PR)"
required: false
type: string
default: ""
pull_request:
branches: ["main"]
merge_group:
Expand Down Expand Up @@ -29,6 +36,8 @@ jobs:
pythonChanges: ${{ steps.filter.outputs.python}}
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.checkout-ref }}
- uses: dorny/paths-filter@v3
id: filter
with:
Expand Down Expand Up @@ -76,6 +85,8 @@ jobs:
working-directory: python
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.checkout-ref }}
- name: Set up python and install the project
id: python-setup
uses: ./.github/actions/python-setup
Expand Down Expand Up @@ -135,6 +146,8 @@ jobs:
working-directory: python
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.checkout-ref }}
- name: Set up python and install the project
id: python-setup
uses: ./.github/actions/python-setup
Expand Down