2022-07-02 01:05:37 +03:00
|
|
|
name: Test
|
2022-06-16 16:17:48 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
2022-07-02 01:05:37 +03:00
|
|
|
# manual trigger
|
|
|
|
workflow_dispatch:
|
2022-06-16 16:17:48 +03:00
|
|
|
|
|
|
|
jobs:
|
2022-07-02 01:05:37 +03:00
|
|
|
lint:
|
2022-06-17 00:42:18 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-07-02 01:05:37 +03:00
|
|
|
- uses: ./.github/actions/setup
|
|
|
|
- run: yarn lint
|
2022-07-14 18:28:51 +03:00
|
|
|
|
2022-07-13 18:31:19 +03:00
|
|
|
deps-tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: ./.github/actions/setup
|
2022-11-24 20:23:56 +03:00
|
|
|
- run: yarn yarn-deduplicate --strategy=highest --list --fail
|
2022-06-17 00:42:18 +03:00
|
|
|
|
2022-07-02 01:05:37 +03:00
|
|
|
unit-tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: ./.github/actions/setup
|
|
|
|
- run: yarn prepare
|
|
|
|
- run: yarn test
|
2022-06-17 00:42:18 +03:00
|
|
|
|
2022-07-02 01:05:37 +03:00
|
|
|
cypress-build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: ./.github/actions/setup
|
2022-06-17 00:42:18 +03:00
|
|
|
- run: yarn prepare
|
|
|
|
|
|
|
|
- run: yarn build
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: build
|
|
|
|
path: build
|
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
id: cypress-cache
|
|
|
|
with:
|
|
|
|
path: /home/runner/.cache/Cypress
|
|
|
|
key: ${{ runner.os }}-cypress-${{ hashFiles('node_modules/cypress') }}
|
|
|
|
- if: steps.cypress-cache.outputs.cache-hit != 'true'
|
|
|
|
run: yarn cypress install
|
2022-07-14 18:28:51 +03:00
|
|
|
|
2022-07-11 18:36:48 +03:00
|
|
|
cypress-test-matrix:
|
2022-07-02 01:05:37 +03:00
|
|
|
needs: cypress-build
|
2022-06-16 16:17:48 +03:00
|
|
|
runs-on: ubuntu-latest
|
2022-06-17 00:42:18 +03:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
containers: [1, 2, 3, 4]
|
2022-06-16 16:17:48 +03:00
|
|
|
steps:
|
2022-06-17 00:42:18 +03:00
|
|
|
- uses: actions/checkout@v3
|
2022-07-02 01:05:37 +03:00
|
|
|
- uses: ./.github/actions/setup
|
2022-06-17 00:42:18 +03:00
|
|
|
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: build
|
|
|
|
path: build
|
|
|
|
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
id: cypress-cache
|
|
|
|
with:
|
|
|
|
path: /home/runner/.cache/Cypress
|
|
|
|
key: ${{ runner.os }}-cypress-${{ hashFiles('node_modules/cypress') }}
|
|
|
|
- if: steps.cypress-cache.outputs.cache-hit != 'true'
|
|
|
|
run: yarn cypress install
|
2022-06-16 16:17:48 +03:00
|
|
|
|
2022-06-17 00:42:18 +03:00
|
|
|
- uses: cypress-io/github-action@v4
|
2022-06-16 16:17:48 +03:00
|
|
|
with:
|
2022-06-17 00:42:18 +03:00
|
|
|
install: false
|
2022-06-16 16:17:48 +03:00
|
|
|
start: yarn serve
|
|
|
|
wait-on: 'http://localhost:3000'
|
|
|
|
browser: chrome
|
|
|
|
record: true
|
2022-06-17 00:42:18 +03:00
|
|
|
parallel: true
|
2022-06-16 16:17:48 +03:00
|
|
|
env:
|
2022-06-16 17:08:25 +03:00
|
|
|
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
2022-07-02 01:12:51 +03:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-07-11 18:36:48 +03:00
|
|
|
|
|
|
|
# Included as a single job to check against for cypress test success, as cypress runs in a matrix.
|
|
|
|
cypress-tests:
|
|
|
|
needs: cypress-test-matrix
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- run: echo 'Finished cypress tests https\://dashboard.cypress.io/projects/yp82ef'
|