2019-10-31 18:28:12 +01:00
|
|
|
name: End-to-end tests
|
2019-10-21 18:20:39 +02:00
|
|
|
|
2019-10-31 13:11:46 +01:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'src/**'
|
|
|
|
- 'package-lock.json'
|
|
|
|
- '.browserslistrc'
|
|
|
|
- '.babelrc'
|
|
|
|
- 'webpack.config.*'
|
|
|
|
- 'public/test/**'
|
|
|
|
- 'cypress/**'
|
2019-11-08 14:24:57 +01:00
|
|
|
- '.github/workflows/e2e-tests.yml'
|
2019-10-21 18:20:39 +02:00
|
|
|
|
|
|
|
jobs:
|
2019-10-23 10:32:25 +02:00
|
|
|
test-e2e:
|
2019-10-21 18:20:39 +02:00
|
|
|
runs-on: ubuntu-latest
|
2019-11-08 14:24:57 +01:00
|
|
|
env:
|
|
|
|
CI: true
|
|
|
|
TERM: xterm-256color
|
|
|
|
|
2019-10-21 18:20:39 +02:00
|
|
|
steps:
|
2021-12-31 02:16:52 +01:00
|
|
|
- uses: actions/checkout@v2
|
2019-10-21 18:20:39 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
|
|
|
|
2021-12-31 02:16:52 +01:00
|
|
|
- uses: actions/setup-node@v2
|
2019-10-21 18:20:39 +02:00
|
|
|
with:
|
2022-11-28 18:08:05 +01:00
|
|
|
node-version: 18.x
|
2019-11-08 14:24:57 +01:00
|
|
|
|
|
|
|
- name: Cache node modules
|
2021-12-31 02:16:52 +01:00
|
|
|
uses: actions/cache@v2
|
2019-11-08 14:24:57 +01:00
|
|
|
with:
|
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.OS }}-build-${{ env.cache-name }}-
|
|
|
|
${{ runner.OS }}-build-
|
|
|
|
${{ runner.OS }}-
|
|
|
|
|
|
|
|
- name: Get Cypress info
|
|
|
|
id: cypress-info
|
|
|
|
run: |
|
|
|
|
echo ::set-output name=version::$(jq -r .devDependencies.cypress ./package.json)
|
|
|
|
echo ::set-output name=cache::$(npx cypress cache path)
|
|
|
|
env:
|
|
|
|
CYPRESS_INSTALL_BINARY: 0
|
|
|
|
- name: Cache Cypress cache
|
2021-12-31 02:16:52 +01:00
|
|
|
uses: actions/cache@v2
|
2019-11-08 14:24:57 +01:00
|
|
|
with:
|
|
|
|
path: ${{ steps.cypress-info.outputs.cache }}
|
|
|
|
key: ${{ runner.OS }}-cypress-${{ steps.cypress-info.outputs.version }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.OS }}-cypress-${{ steps.cypress-info.outputs.version }}
|
2019-10-21 18:20:39 +02:00
|
|
|
|
2019-10-22 23:20:40 +02:00
|
|
|
- name: Install dependencies
|
2019-10-21 18:20:39 +02:00
|
|
|
run: npm ci
|
2019-10-22 23:20:40 +02:00
|
|
|
env:
|
|
|
|
HUSKY_SKIP_INSTALL: true
|
2019-10-21 18:20:39 +02:00
|
|
|
|
2019-11-08 14:24:57 +01:00
|
|
|
- name: run Cypress (with or without recording)
|
|
|
|
# if we have ran out of free Cypress recordings, run Cypress with recording switched off
|
|
|
|
run: npx run-p --race start cypress:ci || npx run-p --race start cypress:run
|
2019-11-02 14:49:33 +01:00
|
|
|
env:
|
|
|
|
NODE_ENV: production # prevent watching
|
|
|
|
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
|
|
|
DEBUG: commit-info,cypress:server:record
|
|
|
|
# https://docs.cypress.io/guides/guides/continuous-integration.html#Environment-variables
|
|
|
|
COMMIT_INFO_BRANCH: ${{ github.head_ref }}
|
|
|
|
COMMIT_INFO_AUTHOR: ${{ github.event.sender.login }}
|
|
|
|
COMMIT_INFO_SHA: ${{ github.event.after }}
|