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

Update GitHub Actions workflows with .nvmrc #610

Merged
merged 7 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
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
34 changes: 21 additions & 13 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,41 @@
name: Integration tests

on: [push, pull_request]
on:
pull_request:

push:
branches:
- main

workflow_dispatch:

concurrency:
group: integration-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
test-saucelabs:
integration:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, interesting - was this just misnamed as test-saucelabs?

name: Build & test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Read node version from .nvmrc
id: nvm
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
- name: Checkout code
uses: actions/[email protected]

- name: "Setup Node v${{ steps.nvm.outputs.NVMRC }}"
uses: actions/setup-node@v2
- name: Setup Node.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤩

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

- 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
40 changes: 19 additions & 21 deletions .github/workflows/saucelabs.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
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:

# 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
Expand All @@ -22,28 +22,26 @@ jobs:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}

steps:
- uses: actions/checkout@v2

- name: Read node version from .nvmrc
id: nvm
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
- name: Checkout code
uses: actions/[email protected]

- 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

- 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 }}
31 changes: 20 additions & 11 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
name: Test

on: [pull_request, push]
on:
pull_request:

push:
branches:
- main

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

steps:
- uses: actions/checkout@v2

- name: Read node version from .nvmrc
id: nvm
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
- name: Checkout code
uses: actions/[email protected]

- 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
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.18.2
lts/fermium
22 changes: 7 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,21 @@ 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:
To install Node (with npm) locally on macOS, we recommend [brew](https://brew.sh) with
Copy link
Contributor

@domoscargin domoscargin Nov 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Phew, I saw Java in the first commit and thought I'd have to brush up...

[nvm](https://github.com/nvm-sh/nvm):

```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, you can use [brew](https://brew.sh/):

```bash
brew install node
brew cask install java
brew install nvm
nvm install
```

## Project structure
Expand Down