Start a Mimicker HTTP mock server in your CI workflows — zero config required.
steps:
- uses: mimickerhq/mimicker-action@v1
- name: Hit your mock
run: curl http://localhost:8080/__mimicker__/healthsteps:
- uses: actions/checkout@v4
- uses: mimickerhq/mimicker-action@v1
with:
config: stubs/api.yaml
- name: Run tests against the mock
run: pytest- uses: mimickerhq/mimicker-action@v1
with:
port: 9090- uses: mimickerhq/mimicker-action@v1
id: mock
- run: curl ${{ steps.mock.outputs.url }}/my-endpointAfter your tests run, call the report script to get a summary of which stubs were hit and which were never exercised. The report is written to the GitHub Actions job summary.
- uses: actions/checkout@v4
- uses: mimickerhq/mimicker-action@v1
id: mock
with:
config: stubs/api.yaml
- name: Run tests
run: pytest
- name: Mimicker coverage report
if: always()
run: bash ${{ steps.mock.outputs.report-script }}Add fail-on-unused: true to fail the job if any stub was never hit:
- uses: mimickerhq/mimicker-action@v1
id: mock
with:
config: stubs/api.yaml
fail-on-unused: true
- name: Run tests
run: pytest
- name: Mimicker coverage report
if: always()
run: bash ${{ steps.mock.outputs.report-script }}| Input | Description | Default |
|---|---|---|
port |
Port to run Mimicker on | 8080 |
config |
Path to a stubs YAML file (relative to repo root) | — |
version |
Mimicker Docker image tag | latest |
wait-timeout |
Seconds to wait for the server to become healthy | 30 |
fail-on-unused |
Fail the job if any stubs were never hit (detects test decay) | false |
| Output | Description |
|---|---|
url |
Base URL of the running server, e.g. http://localhost:8080 |
report-script |
Path to a shell script that writes the stub coverage report to the job summary. Call it with if: always() after your tests. |
# stubs/api.yaml
routes:
- method: GET
path: /users
status: 200
body:
- id: 1
name: Alice
- method: POST
path: /orders
status: 201
body:
id: 42
status: createdSee the Mimicker docs for the full YAML reference.
Working examples you can clone and run:
| Example | What it shows |
|---|---|
| basic | Minimal setup — no stubs, health check only |
| with-stubs | YAML stubs + curl assertions |
| coverage-report | Stub coverage tracking and fail-on-unused |
Apache 2.0 — see LICENSE.
