-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #610 from alphagov/configure-node
Update GitHub Actions workflows with `.nvmrc`
- Loading branch information
Showing
5 changed files
with
68 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
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 | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
14.18.2 | ||
lts/fermium |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters