Skip to content

Add cross-repo test triggering to CI workflow #100

Add cross-repo test triggering to CI workflow

Add cross-repo test triggering to CI workflow #100

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python package
permissions:
contents: read
on:
push:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.13"]
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install Hatch
run: |
python -m pip install --upgrade hatch
- name: static analysis
run: hatch fmt --check
- name: type checking
run: hatch run types:check
- name: Run tests + coverage
run: hatch run test:cov
- name: Build distribution
run: hatch build
trigger-tests:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
repositories: aws-durable-execution-sdk-python-testing
- name: Trigger tests in aws-durable-execution-sdk-python-testing
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ steps.app-token.outputs.token }}
repository: aws/aws-durable-execution-sdk-python-testing
event-type: test-pr
client-payload: |
{
"pr_number": "${{ github.event.number }}",
"pr_sha": "${{ github.event.pull_request.head.sha }}",
"pr_ref": "${{ github.event.pull_request.head.ref }}",
"source_repo": "${{ github.repository }}"
}