From 5eb85101b2ce6e8d25de271913dd38d602bb74a7 Mon Sep 17 00:00:00 2001 From: Russell Garner Date: Fri, 17 Nov 2023 12:02:38 +0000 Subject: [PATCH 1/7] =?UTF-8?q?Allow=20Node.js=20LTS=20=E2=80=98Fermium?= =?UTF-8?q?=E2=80=99=20(v14)=20releases?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also update CONTRIBUTING.md to match --- .nvmrc | 2 +- CONTRIBUTING.md | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.nvmrc b/.nvmrc index ed9f5a0a..518633e1 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -14.18.2 +lts/fermium diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d7300cc3..ed2ee389 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,13 +6,13 @@ If you want to help and want to get more familiar with the codebase, try startin ## Requirements -You will need a recent version of Node and npm installed: +You will need a recent version of Node and npm installed. Check the `.nvmrc` for a recommended version: ```bash $ node -v -v7.10.0 +v14.21.3 $ npm -v -v5.0.0 +v6.14.18 ``` If you want to run the selenium tests, you will also need a local copy of the Java Development Kit: @@ -24,10 +24,12 @@ Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode) ``` -To install Node (with npm) and Java locally on macOS, you can use [brew](https://brew.sh/): +To install Node (with npm) and Java locally on macOS, we recommend [brew](https://brew.sh) with +[nvm](https://github.com/nvm-sh/nvm): ```bash -brew install node +brew install nvm +nvm install brew cask install java ``` From 16e81993e8960f6c1d151c2f72042e9e696ffee3 Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Mon, 20 Nov 2023 16:51:23 +0000 Subject: [PATCH 2/7] Remove mention of Java install for local Selenium service Was removed in b95c14a826c43235340f591ff74fc8e8ccfc5d0c --- CONTRIBUTING.md | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed2ee389..0953e305 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,22 +15,12 @@ $ npm -v v6.14.18 ``` -If you want to run the selenium tests, you will also need a local copy of the Java Development Kit: - -```bash -$ java -version -java version "1.8.0_131" -Java(TM) SE Runtime Environment (build 1.8.0_131-b11) -Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode) -``` - -To install Node (with npm) and Java locally on macOS, we recommend [brew](https://brew.sh) with +To install Node (with npm) locally on macOS, we recommend [brew](https://brew.sh) with [nvm](https://github.com/nvm-sh/nvm): ```bash brew install nvm nvm install -brew cask install java ``` ## Project structure From 365bb8e22ccc02008a6c4afa95007bed997cc70f Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Fri, 17 Nov 2023 14:25:30 +0000 Subject: [PATCH 3/7] Limit all GitHub Actions workflows Allows for `pull_request` status checks, every `push` to main branch, but also enables manual `workflow_dispatch` runs --- .github/workflows/integration_tests.yaml | 8 +++++++- .github/workflows/saucelabs.yaml | 6 +++--- .github/workflows/test.yaml | 9 ++++++++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integration_tests.yaml b/.github/workflows/integration_tests.yaml index c28e111c..bd086a8d 100644 --- a/.github/workflows/integration_tests.yaml +++ b/.github/workflows/integration_tests.yaml @@ -1,7 +1,13 @@ name: Integration tests -on: [push, pull_request] +on: + pull_request: + push: + branches: + - main + + workflow_dispatch: jobs: test-saucelabs: diff --git a/.github/workflows/saucelabs.yaml b/.github/workflows/saucelabs.yaml index 1fad80b7..ef47c75d 100644 --- a/.github/workflows/saucelabs.yaml +++ b/.github/workflows/saucelabs.yaml @@ -3,14 +3,14 @@ name: Cross-browser tests # Our Sauce Labs account only allows 5 tests to run at a time. concurrency: saucelabs -# Run for pull requests, or after changes to main branch, but not for any old -# branch, to limit number of workflows contending for Sauce Labs access. on: + pull_request: + push: branches: - main - pull_request: + workflow_dispatch: jobs: test-saucelabs: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2dad4d27..c9e55478 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,6 +1,13 @@ name: Test -on: [pull_request, push] +on: + pull_request: + + push: + branches: + - main + + workflow_dispatch: jobs: build: From 4f51b22bd49bddde0eb521d862fd1ce7d18ad51d Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Fri, 17 Nov 2023 14:29:16 +0000 Subject: [PATCH 4/7] Update GitHub checkout action --- .github/workflows/integration_tests.yaml | 3 ++- .github/workflows/saucelabs.yaml | 3 ++- .github/workflows/test.yaml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration_tests.yaml b/.github/workflows/integration_tests.yaml index bd086a8d..05f7bae4 100644 --- a/.github/workflows/integration_tests.yaml +++ b/.github/workflows/integration_tests.yaml @@ -15,7 +15,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v4.1.1 - name: Read node version from .nvmrc id: nvm diff --git a/.github/workflows/saucelabs.yaml b/.github/workflows/saucelabs.yaml index ef47c75d..c380133b 100644 --- a/.github/workflows/saucelabs.yaml +++ b/.github/workflows/saucelabs.yaml @@ -22,7 +22,8 @@ jobs: if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} steps: - - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v4.1.1 - name: Read node version from .nvmrc id: nvm diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c9e55478..9921a0bf 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,7 +15,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v4.1.1 - name: Read node version from .nvmrc id: nvm From bde8f10851420c7920bc9b5411a11720b9b390ef Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Fri, 17 Nov 2023 14:29:57 +0000 Subject: [PATCH 5/7] Update GitHub setup-node action --- .github/workflows/integration_tests.yaml | 13 +++++-------- .github/workflows/saucelabs.yaml | 13 +++++-------- .github/workflows/test.yaml | 13 +++++-------- 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/.github/workflows/integration_tests.yaml b/.github/workflows/integration_tests.yaml index 05f7bae4..47a47753 100644 --- a/.github/workflows/integration_tests.yaml +++ b/.github/workflows/integration_tests.yaml @@ -18,15 +18,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4.1.1 - - name: Read node version from .nvmrc - id: nvm - run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)" - - - name: "Setup Node v${{ steps.nvm.outputs.NVMRC }}" - uses: actions/setup-node@v2 + - name: Setup Node.js + uses: actions/setup-node@v4.0.0 with: - node-version: "${{ steps.nvm.outputs.NVMRC }}" - cache: 'npm' + cache: npm + check-latest: true + node-version-file: .nvmrc - name: Install dependencies run: npm ci diff --git a/.github/workflows/saucelabs.yaml b/.github/workflows/saucelabs.yaml index c380133b..5bebc43c 100644 --- a/.github/workflows/saucelabs.yaml +++ b/.github/workflows/saucelabs.yaml @@ -25,15 +25,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4.1.1 - - name: Read node version from .nvmrc - id: nvm - run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)" - - - name: "Setup Node v${{ steps.nvm.outputs.NVMRC }}" - uses: actions/setup-node@v2 + - name: Setup Node.js + uses: actions/setup-node@v4.0.0 with: - node-version: "${{ steps.nvm.outputs.NVMRC }}" - cache: 'npm' + cache: npm + check-latest: true + node-version-file: .nvmrc - name: Install dependencies run: npm ci diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9921a0bf..83f12e30 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -18,15 +18,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4.1.1 - - name: Read node version from .nvmrc - id: nvm - run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)" - - - name: "Setup Node v${{ steps.nvm.outputs.NVMRC }}" - uses: actions/setup-node@v2 + - name: Setup Node.js + uses: actions/setup-node@v4.0.0 with: - node-version: "${{ steps.nvm.outputs.NVMRC }}" - cache: 'npm' + cache: npm + check-latest: true + node-version-file: .nvmrc - name: Install dependencies run: npm ci From 5d8fc9e85735888ba3259a50f6ee67c9a78a4b14 Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Fri, 17 Nov 2023 14:31:10 +0000 Subject: [PATCH 6/7] Allow GitHub Actions to cancel in-progress workflows Also ensures job names match concurrency group names --- .github/workflows/integration_tests.yaml | 6 +++++- .github/workflows/saucelabs.yaml | 8 ++++---- .github/workflows/test.yaml | 6 +++++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/integration_tests.yaml b/.github/workflows/integration_tests.yaml index 47a47753..9cd4998e 100644 --- a/.github/workflows/integration_tests.yaml +++ b/.github/workflows/integration_tests.yaml @@ -9,8 +9,12 @@ on: workflow_dispatch: +concurrency: + group: integration-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: - test-saucelabs: + integration: name: Build & test runs-on: ubuntu-latest diff --git a/.github/workflows/saucelabs.yaml b/.github/workflows/saucelabs.yaml index 5bebc43c..0b0410c0 100644 --- a/.github/workflows/saucelabs.yaml +++ b/.github/workflows/saucelabs.yaml @@ -1,8 +1,5 @@ name: Cross-browser tests -# Our Sauce Labs account only allows 5 tests to run at a time. -concurrency: saucelabs - on: pull_request: @@ -12,8 +9,11 @@ on: workflow_dispatch: +# Our Sauce Labs account only allows 5 tests to run at a time. +concurrency: saucelabs + jobs: - test-saucelabs: + saucelabs: name: Build & test (with Sauce Labs) runs-on: ubuntu-latest timeout-minutes: 15 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 83f12e30..634fdd88 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -9,8 +9,12 @@ on: workflow_dispatch: +concurrency: + group: tests-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: - build: + test: name: Build & basic tests runs-on: ubuntu-latest From 4e9caf858f6f091c46f7c0c6614f46d464e572ba Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Fri, 17 Nov 2023 14:31:44 +0000 Subject: [PATCH 7/7] Formatting etc --- .github/workflows/integration_tests.yaml | 4 ++-- .github/workflows/saucelabs.yaml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/integration_tests.yaml b/.github/workflows/integration_tests.yaml index 9cd4998e..0c11b7ed 100644 --- a/.github/workflows/integration_tests.yaml +++ b/.github/workflows/integration_tests.yaml @@ -35,7 +35,7 @@ jobs: - name: Build run: npm run build - - name: "Run integration tests" + - name: Run browser tests (without Sauce Labs) run: npm run wdio:test env: - SAUCE_ENABLED: "false" # ensure we don't use Sauce Labs + SAUCE_ENABLED: false diff --git a/.github/workflows/saucelabs.yaml b/.github/workflows/saucelabs.yaml index 0b0410c0..8f3af714 100644 --- a/.github/workflows/saucelabs.yaml +++ b/.github/workflows/saucelabs.yaml @@ -38,10 +38,10 @@ jobs: - name: Build run: npm run build - - name: "Run cross-browser tests (using Sauce Labs)" + - name: Run browser tests (with Sauce Labs) run: npm run wdio:test env: - SAUCE_ENABLED: "true" - SAUCE_BUILD_NUMBER: "${{ github.run_id }}" - SAUCE_USERNAME: "${{ secrets.SAUCE_USERNAME }}" - SAUCE_ACCESS_KEY: "${{ secrets.SAUCE_ACCESS_KEY }}" + SAUCE_ENABLED: true + SAUCE_BUILD_NUMBER: ${{ github.run_id }} + SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} + SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}