Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README.md: Modern GitHub Actions Ubuntu images include xvfb #31

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# XVFB Github Action

This action installs [XVFB](http://elementalselenium.com/tips/38-headless) and runs your headless tests with it. It cleans up the xvfb process after your tests are done. If it detects you're not using linux then your tests still run, but without xvfb, which is very practical for multi-platform workflows.
This action installs [XVFB](http://elementalselenium.com/tips/38-headless) and runs your headless tests with it. It cleans up the `xvfb` process after your tests are done. If it detects you're **not** using Ubuntu, your tests still run without `xvfb`, which is very practical for multi-platform workflows.

### Example usage

Expand All @@ -15,11 +15,20 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Run headless test
uses: coactions/setup-xvfb@v1
with:
run: npm test
working-directory: ./ #optional
options: #optional
```

Modern [GitHub Actions Ubuntu images](https://github.com/actions/runner-images/tree/main/images/ubuntu) now include `xvfb` so this Action could be replaced by:

```yml
- if: runner.os == 'Linux'
run: xvfb-run npm test
- if: runner.os != 'Linux'
run: npm test
```