Sets up a Wiremock API using the provided stubs.
Requirements: Java (preferably Java 11)
Required Path to folder with JSON stubs.
References:
- http://wiremock.org/docs/running-standalone/#json-file-configuration
- http://wiremock.org/docs/stubbing/
Required Path to folder with static files. Use these files in the mappings to fill out the response body.
References:
Required Command to run tests
Note: a child process is spawned and run in a shell with this command, so do not run unvalidated commands.
Example: 'npm test --testNamePattern=MyApiTests'
Port on which to run Wiremock. Defaults to 8080.
Turns on verbose Wiremock logging (log all requests and responses). Defaults to false (only log stub mismatches).
Logs from Wiremock. If any stubs are not matched, they will be reported here.
on: [push]
jobs:
test:
runs-on: ubuntu-latest
name: Set up WireMock as a standalone process
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Action E2E Test
uses: williamhaw/setup-wiremock-action@v0.1.2
id: setup-wiremock
with:
http-port: '8080'
mappings: 'example-mapping-directory'
files: 'example-files-directory'
command: 'node example.test.js'
verbose: false
- name: Get the WireMock standard output
run: echo "${{ steps.setup-wiremock.outputs.wiremock-stdout }}"