Install restk-cli in your GitHub Actions workflow for API testing.
jobs:
api-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install restk-cli
uses: restk-org/setup-cli@v1
with:
version: latest # or "1.0.0" for pinned version
- name: Run API tests
run: restk-cli run --preset ./restk/runners/smoke.runner.yaml --dir ./restk --env staging| Input | Default | Description |
|---|---|---|
version |
latest |
CLI version (latest or semver like 1.0.0) |
channel |
production |
Release channel (production or staging) |
| Output | Description |
|---|---|
version |
Installed CLI version string |
path |
Full path to the binary |
- Auto-detects OS and architecture (Linux, macOS, Windows × amd64, arm64)
- Caches binary between runs (keyed by version + platform)
- Verifies download with HTTP status check
- Adds to
$GITHUB_PATHautomatically
- uses: restk-org/setup-cli@v1
with:
version: '1.0.0'- uses: restk-org/setup-cli@v1
with:
channel: stagingname: API Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: restk-org/setup-cli@v1
- name: Run smoke tests
run: restk-cli run --preset ./restk/runners/smoke.runner.yaml --dir ./restk --env staging --output results.json
- name: Upload results
if: always()
uses: actions/upload-artifact@v4
with:
name: api-test-results
path: results.jsonTo publish to the GitHub Marketplace:
- Create a new repo:
github.com/restk-org/setup-cli - Copy
action.ymlandREADME.mdto the repo root - Tag:
git tag -a v1 -m "v1.0.0" && git push origin v1 - Publish to Marketplace via GitHub UI