Run Yapi integration tests in GitHub Actions with automatic service orchestration and health checks.
Use the latest version from main:
- uses: jamierpond/yapi/action@main
with:
command: yapi test ./testsOr use a specific version tag:
- uses: jamierpond/yapi/action@v0.5.0
with:
command: yapi test ./testsThe action automatically installs the matching yapi version based on the action ref you use. For example, @v0.5.0 installs yapi v0.5.0, while @main installs the latest version.
name: Integration Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jamierpond/yapi/action@v0.5.0
with:
command: yapi test ./tests- uses: jamierpond/yapi/action@v0.5.0
with:
start: npm run dev
wait-on: http://localhost:3000/health
command: yapi test ./tests- uses: jamierpond/yapi/action@v0.5.0
with:
start: |
npm run api
python worker.py
wait-on: |
http://localhost:8080/health
http://localhost:9000/ready
command: yapi test ./integration| Input | Required | Default | Description |
|---|---|---|---|
command |
No | yapi test . |
The yapi command to run |
start |
No | "" |
Commands to run in background (one per line) |
wait-on |
No | "" |
URLs to wait for before running tests (one per line) |
wait-on-timeout |
No | 60000 |
Health check timeout in milliseconds |
- Installs yapi CLI
- Starts background services
- Waits for health checks
- Runs your tests
- Fails if tests fail