A Github action to run a command (e.g. e2e tests) while also running another commands in the background (e.g. servers).
name: Run E2E tests
on: [ push ]
jobs:
run-test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run E2E Tests
uses: maximedeoliveira/background-servers@latest
with:
command: npm run test
This parameter is the command to run while everything is ready.
You can run a build step before running command or starting your app.
If your tests run against a local server, you can use start parameter, the server will run in the background.
You can start multiple servers using comma separations (e.g. npm run web, npm run api).
If you are starting local servers, and it takes a while to start, you can use wait-on parameter and pass url to wait for the server to respond.
By default, wait-on will retry for 60 seconds.You can pass a custom timeout in seconds using wait-on-timeout.
You can use debug parameter to print action steps.