47 lines
1.3 KiB
YAML
47 lines
1.3 KiB
YAML
name: Node.js CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [16.x]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Get yarn cache directory path
|
|
id: yarn-cache-dir-path
|
|
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
|
|
|
- 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-
|
|
|
|
- run: yarn install
|
|
- run: yarn typecheck
|
|
- run: yarn lint:all --max-warnings 0
|
|
- run: yarn test
|
|
- name: Download playwright
|
|
run: yarn workspace playground run playwright install
|
|
- name: Run e2e tests with percy
|
|
uses: percy/exec-action@v0.3.1
|
|
with:
|
|
custom-command: 'yarn test:e2e:ci'
|
|
env:
|
|
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
|