Skip to content

Tests

Tests #974

Workflow file for this run

name: Tests
on:
push:
branches:
- '**'
paths-ignore:
- 'server/**'
pull_request:
branches:
- '**'
paths-ignore:
- 'server/**'
# Runs everyday to detect GitHub update in time
schedule:
- cron: '30 16 * * *'
jobs:
build:
uses: ./.github/workflows/build.yml
e2e-test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download a built dist artifact
uses: actions/download-artifact@v3
with:
name: dist
path: dist
# Found no way to reuse cache steps
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache deps
uses: actions/cache@v1
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
run: |
yarn --ignore-platform --ignore-engines --frozen-lockfile --prefer-offline
- name: E2E Test
uses: mymindstorm/puppeteer-headful@8f745c770f7f4c0f9f332d7c43a775f90e53779a
env:
CI: 'true'
with:
args: yarn test
unit-test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download a built dist artifact
uses: actions/download-artifact@v3
with:
name: dist
# Found no way to reuse cache steps
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache deps
uses: actions/cache@v1
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
run: |
yarn --ignore-platform --ignore-engines --frozen-lockfile --prefer-offline
- name: Unit Test
run: |
yarn jest src