diff --git a/README.md b/README.md index c4dbe9e..f0bb456 100644 --- a/README.md +++ b/README.md @@ -160,9 +160,33 @@ $ browserify test.js | tape-run --render="tap-spec" ``` -## Headless testing / Travis +## Headless testing -To use tape-run with travis, we recommend using the default electron browser, which however requires you to add this part to your travis.yml: +In environments without a screen, you can use `Xvfb` to simulate one. We recommend using the default electron browser, +which however requires you to add additional parts to your headless configurations. + +### GitHub Actions + +This is a full example to run `npm test`. Refer to the last 2 lines in the YAML config: + +```yml +on: + - pull_request + - push + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - run: npm install + - run: sudo apt-get install xvfb + - run: xvfb-run --auto-servernum npm test +``` + +### Travis + +Add this to your travis.yml: ```yml addons: @@ -175,9 +199,9 @@ install: - npm install ``` -[Source](https://github.com/rhysd/Shiba/blob/055a11a0a2b4f727577fe61371a88d8db9277de5/.travis.yml). +[Full example](https://github.com/rhysd/Shiba/blob/055a11a0a2b4f727577fe61371a88d8db9277de5/.travis.yml). -For gnu/linux installations without a graphical environment: +### Any gnu/linux box ```bash $ sudo apt-get install xvfb # or equivalent @@ -186,7 +210,9 @@ $ Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & $ browser-run ... ``` -There is also an example docker machine [here](https://github.com/fraserxu/docker-tape-run). +### Docker + +There is also an example [Docker image](https://hub.docker.com/r/kipparker/docker-tape-run). [Source](https://github.com/fraserxu/docker-tape-run) ## Installation