From 2d081ad18939ddd64d2b6528c96c90e96a2fc7e5 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 27 Mar 2024 08:52:58 +0100 Subject: [PATCH 1/4] README.md: Modern GitHub Actions Ubuntu images include xvfb Fixes #21 An alternative proposal to #30 * #21 * #30 --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e6b8c85..910428f 100644 --- a/README.md +++ b/README.md @@ -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 @@ -15,7 +15,7 @@ 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: @@ -23,3 +23,11 @@ jobs: 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: startsWith(matrix.os, 'ubuntu') + run: xvfb-run npm test + - if: "!startsWith(matrix.os, 'ubuntu')" + run: npm test +``` From bd647eec54679f9f038ab98338061289521ba86e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 07:54:10 +0000 Subject: [PATCH 2/4] chore: auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 910428f..5cfd031 100644 --- a/README.md +++ b/README.md @@ -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 Ubuntu, your tests still run 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 @@ -25,9 +25,10 @@ jobs: ``` 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: startsWith(matrix.os, 'ubuntu') - run: xvfb-run npm test - - if: "!startsWith(matrix.os, 'ubuntu')" - run: npm test +- if: startsWith(matrix.os, 'ubuntu') + run: xvfb-run npm test +- if: "!startsWith(matrix.os, 'ubuntu')" + run: npm test ``` From 13d7f6267cb6088370a342e673caf4f68e0de516 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 22 Apr 2024 00:37:14 +0200 Subject: [PATCH 3/4] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5cfd031..42676ee 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,8 @@ jobs: 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: startsWith(matrix.os, 'ubuntu') +- if: runner.os == 'Linux' run: xvfb-run npm test -- if: "!startsWith(matrix.os, 'ubuntu')" +- if: ${{ ! runner.os == 'Linux' }} run: npm test ``` From 365a1f025fcae93665678b23baf3de41f1f2d4ae Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 17 Jun 2024 17:20:36 -0400 Subject: [PATCH 4/4] if: runner.os != 'Linux' Co-authored-by: Marcin Rataj --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 42676ee..068f2ed 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,6 @@ Modern [GitHub Actions Ubuntu images](https://github.com/actions/runner-images/t ```yml - if: runner.os == 'Linux' run: xvfb-run npm test -- if: ${{ ! runner.os == 'Linux' }} +- if: runner.os != 'Linux' run: npm test ```