This guide explains how to set up cross-repository webhook triggers for automated integration testing.
The integration test suite in ascoderu/iiab-lokole-tests is triggered by events in other repositories:
- Lokole repository (
ascoderu/lokole) - triggers on PR labels and merges - IIAB repository (
iiab/iiab) - triggers on PR labels and merges
┌─────────────────────────────────────────────────────────────┐
│ Lokole/IIAB Repository │
│ PR labeled 'test-iiab-integration' │
│ └── Workflow: .github/workflows/trigger-integration.yml │
│ └── repository_dispatch → iiab-lokole-tests │
└─────────────────────────────────────────────────────────────┘
↓
┌─────────────────────────────────────────────────────────────┐
│ iiab-lokole-tests Repository │
│ Receives repository_dispatch event │
│ └── Workflow: .github/workflows/test-on-pr-label.yml │
│ └── Runs tests, posts results back to original PR │
└─────────────────────────────────────────────────────────────┘
Create a GitHub PAT with the following scopes:
repo(full control)workflow(update workflows)
Store this token as:
- In lokole repo: Secret named
INTEGRATION_TEST_PAT - In IIAB repo: Secret named
INTEGRATION_TEST_PAT - In iiab-lokole-tests repo: Secret named
INTEGRATION_TEST_PAT
The PAT owner must have:
- Write access to
ascoderu/iiab-lokole-tests - Read access to
ascoderu/lokoleandiiab/iiab
Create .github/workflows/trigger-integration-tests.yml in the ascoderu/lokole repository:
name: Trigger Integration Tests
on:
pull_request:
types: [labeled, synchronize]
push:
branches:
- master
jobs:
trigger-on-label:
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'test-iiab-integration')
runs-on: ubuntu-latest
steps:
- name: Trigger integration tests
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.INTEGRATION_TEST_PAT }}
repository: ascoderu/iiab-lokole-tests
event-type: test-integration-lokole
client-payload: |
{
"pr_number": ${{ github.event.pull_request.number }},
"ref": "${{ github.event.pull_request.head.ref }}",
"sha": "${{ github.event.pull_request.head.sha }}",
"repo": "${{ github.repository }}"
}
trigger-on-merge:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Trigger post-merge tests
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.INTEGRATION_TEST_PAT }}
repository: ascoderu/iiab-lokole-tests
event-type: lokole-merged
client-payload: |
{
"branch": "${{ github.ref_name }}",
"sha": "${{ github.sha }}",
"repo": "${{ github.repository }}"
}Create .github/workflows/trigger-integration-tests.yml in the iiab/iiab repository:
name: Trigger Lokole Integration Tests
on:
pull_request:
types: [labeled, synchronize]
paths:
- 'roles/lokole/**'
push:
branches:
- master
paths:
- 'roles/lokole/**'
jobs:
trigger-on-label:
if: github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'test-iiab-integration')
runs-on: ubuntu-latest
steps:
- name: Trigger integration tests
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.INTEGRATION_TEST_PAT }}
repository: ascoderu/iiab-lokole-tests
event-type: test-integration-iiab
client-payload: |
{
"pr_number": ${{ github.event.pull_request.number }},
"ref": "${{ github.event.pull_request.head.ref }}",
"sha": "${{ github.event.pull_request.head.sha }}",
"repo": "${{ github.repository }}"
}
trigger-on-merge:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Trigger post-merge tests
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.INTEGRATION_TEST_PAT }}
repository: ascoderu/iiab-lokole-tests
event-type: iiab-merged
client-payload: |
{
"branch": "${{ github.ref_name }}",
"sha": "${{ github.sha }}",
"repo": "${{ github.repository }}"
}- Go to Settings → Secrets and variables → Actions
- Add secret:
INTEGRATION_TEST_PAT=<your PAT>
- Go to Settings → Secrets and variables → Actions
- Add secret:
INTEGRATION_TEST_PAT=<your PAT>
- Go to Settings → Secrets and variables → Actions
- Add secret:
INTEGRATION_TEST_PAT=<your PAT>
- Create a test PR in the lokole repository
- Add the label
test-iiab-integration - Check Actions tab in
ascoderu/iiab-lokole-testsfor workflow run - Results should be posted as a comment on the original PR
- Open your PR in lokole or IIAB repository
- Add label:
test-iiab-integration - Integration tests will run automatically
- Results posted as PR comment
In the iiab-lokole-tests repository:
- Go to Actions → Test Ubuntu LTS Versions
- Click "Run workflow"
- Configure:
- Ubuntu version (22.04, 24.04, 26.04, or all)
- Lokole version (leave empty for latest PyPI)
- IIAB branch (default: master)
- Pre-release testing (enable for daily builds)
The workflow test-ubuntu-lts.yml runs automatically:
- Schedule: Weekly on Sundays at 2 AM UTC
- Purpose: Detect regressions across Ubuntu LTS versions
- Automatic issue creation: On failure, creates issue with logs
After merging to master:
- Lokole merges trigger tests with the merged commit
- IIAB merges trigger tests with the updated role
- Failures create issues automatically
-
Check PAT permissions:
- Go to GitHub Settings → Developer settings → Personal access tokens
- Verify
repoandworkflowscopes are enabled
-
Check secret configuration:
- Repository Settings → Secrets → Actions
- Verify
INTEGRATION_TEST_PATexists
-
Check label name:
- Must be exactly
test-iiab-integration(case-sensitive)
- Must be exactly
- Check PAT has write access to the PR's repository
- Review workflow logs in iiab-lokole-tests Actions tab
- Verify client_payload contains correct repository info
If tests fail with Multipass errors:
- GitHub Actions runners have limited nested virtualization
- Tests may need adjustment for runner environment
- Check logs:
multipass version,multipass find
| File | Repository | Purpose |
|---|---|---|
trigger-integration-tests.yml |
lokole, iiab | Dispatch events to test repo |
test-on-pr-label.yml |
iiab-lokole-tests | Run tests on PR label |
test-on-merge.yml |
iiab-lokole-tests | Run tests post-merge |
test-ubuntu-lts.yml |
iiab-lokole-tests | Scheduled & manual tests |
| Event Type | Triggered By | Payload |
|---|---|---|
test-integration-lokole |
Lokole PR labeled | pr_number, ref, sha, repo |
test-integration-iiab |
IIAB PR labeled | pr_number, ref, sha, repo |
lokole-merged |
Lokole master push | branch, sha, repo |
iiab-merged |
IIAB master push | branch, sha, repo |
test-on-pr-label.yml
└── scripts/scenarios/test-pr-branch.sh
├── scripts/vm/multipass/setup-vm.sh
├── scripts/vm/multipass/install-iiab.sh
│ └── scripts/monitoring/monitor_installation.py
└── scripts/verify/verify-installation.sh
- Add composite actions: Reusable action components in
.github/actions/ - Matrix testing: Expand to test multiple Python versions
- Performance baselines: Track installation times
- Integration with IIAB CI: Coordinate with existing IIAB workflows