2020-08-14 22:34:43 +08:00
|
|
|
name: build
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
2020-08-19 23:30:52 +08:00
|
|
|
test:
|
2020-08-14 22:34:43 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: [14.x]
|
|
|
|
|
|
|
|
steps:
|
2020-08-19 23:28:46 +08:00
|
|
|
|
2020-08-14 22:34:43 +08:00
|
|
|
- uses: actions/checkout@v2.3.2
|
2020-08-19 23:28:46 +08:00
|
|
|
|
2020-08-14 22:34:43 +08:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
|
|
uses: actions/setup-node@v2.1.1
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2020-08-19 23:28:46 +08:00
|
|
|
|
2020-08-19 23:35:52 +08:00
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
|
|
|
|
- name: Restore yarn cache directory
|
|
|
|
uses: actions/cache@v2
|
|
|
|
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
|
|
with:
|
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-yarn-
|
|
|
|
|
2020-08-19 23:28:46 +08:00
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn install
|
|
|
|
|
2020-08-20 20:37:25 +08:00
|
|
|
- name: Build packages
|
|
|
|
run: yarn build:packages
|
|
|
|
|
2020-08-19 23:28:46 +08:00
|
|
|
- name: Cypress run
|
|
|
|
uses: cypress-io/github-action@v2
|
|
|
|
with:
|
|
|
|
browser: chrome
|
|
|
|
command: yarn run startandtest
|
|
|
|
|
2020-08-19 23:38:05 +08:00
|
|
|
- name: Export screenshots (on failure only)
|
2020-08-19 23:33:39 +08:00
|
|
|
uses: actions/upload-artifact@v1
|
2020-08-19 23:28:46 +08:00
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: cypress-screenshots
|
2020-08-19 23:33:39 +08:00
|
|
|
path: tests/cypress/screenshots
|
2020-08-19 23:28:46 +08:00
|
|
|
|
2020-08-19 23:38:05 +08:00
|
|
|
- name: Export screen recordings (on failure only)
|
2020-08-19 23:33:39 +08:00
|
|
|
uses: actions/upload-artifact@v1
|
2020-08-19 23:38:05 +08:00
|
|
|
if: failure()
|
2020-08-19 23:28:46 +08:00
|
|
|
with:
|
|
|
|
name: cypress-videos
|
2020-08-19 23:33:39 +08:00
|
|
|
path: tests/cypress/videos
|