2021-06-18 14:08:10 +02:00
|
|
|
name: Node.js CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-06-18 19:00:12 +02:00
|
|
|
branches: [main]
|
2021-06-18 14:08:10 +02:00
|
|
|
pull_request:
|
2021-06-18 19:00:12 +02:00
|
|
|
branches: [main]
|
2021-06-18 14:08:10 +02:00
|
|
|
|
|
|
|
jobs:
|
2022-05-18 12:09:45 +02:00
|
|
|
Test:
|
2021-06-18 14:08:10 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: [16.x]
|
|
|
|
|
|
|
|
steps:
|
2023-01-26 16:16:14 +01:00
|
|
|
- uses: actions/checkout@v3
|
2021-06-18 14:08:10 +02:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2023-01-26 16:16:14 +01:00
|
|
|
uses: actions/setup-node@v3
|
2021-06-18 14:08:10 +02:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2023-01-26 16:16:14 +01:00
|
|
|
# cache: 'yarn'
|
2021-06-18 19:00:12 +02:00
|
|
|
|
2023-01-26 16:16:14 +01:00
|
|
|
# - name: Get yarn cache directory path
|
|
|
|
# id: yarn-cache-dir-path
|
|
|
|
# run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
2021-06-18 19:00:12 +02:00
|
|
|
|
2023-01-26 16:16:14 +01:00
|
|
|
# - uses: actions/cache@v2
|
|
|
|
# id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
|
|
# with:
|
|
|
|
# # Note that we assume the following things about the compatibility tests here:
|
|
|
|
# # 1. Every directory in `build_test` is a project managed with yarn
|
|
|
|
# # 2. All these projects store their cache in `<project>/.yarn/cache`
|
|
|
|
# # It's not that robust, but should be sufficient for us for now.
|
|
|
|
# path: |
|
|
|
|
# ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
|
|
# ${{ github.workspace }}/compatibility-tests/*/.yarn/cache
|
|
|
|
# key:
|
|
|
|
# ${{ runner.os }}-${{ matrix.node-version }}-yarn-${{
|
|
|
|
# hashFiles('**/yarn.lock') }}
|
|
|
|
# restore-keys: |
|
|
|
|
# ${{ runner.os }}-${{ matrix.node-version }}-yarn-
|
|
|
|
|
|
|
|
- name: Restore node_modules
|
|
|
|
id: yarn-node-modules-cache
|
|
|
|
uses: actions/cache@v3
|
2021-06-18 19:00:12 +02:00
|
|
|
with:
|
2022-05-17 20:53:01 +02:00
|
|
|
path: |
|
2023-01-26 16:16:14 +01:00
|
|
|
**/node_modules
|
|
|
|
.yarn/cache
|
2022-07-25 10:37:34 +02:00
|
|
|
key:
|
2023-01-26 16:16:14 +01:00
|
|
|
${{ runner.os }}-yarn-mono-nm-node-modules-${{
|
|
|
|
hashFiles('yarn.lock', '.yarnrc.yml') }}
|
|
|
|
|
|
|
|
# Thanks to https://github.com/rafaelbiten for this step https://github.com/microsoft/playwright/issues/7249#issuecomment-1385567519
|
|
|
|
- name: Cache Playwright Browsers for Playwright's Version
|
|
|
|
id: cache-playwright-browsers
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ~/.cache/ms-playwright
|
|
|
|
key: ${{ runner.os }}-playwright-${{ hashFiles('yarn.lock') }}
|
|
|
|
|
|
|
|
- run: yarn install --immutable --inline-builds
|
|
|
|
env:
|
|
|
|
YARN_NM_MODE: 'hardlinks-local'
|
2021-06-18 19:00:12 +02:00
|
|
|
|
2022-04-09 15:23:03 +02:00
|
|
|
- run: yarn lint:all --max-warnings 0
|
2021-06-18 19:00:12 +02:00
|
|
|
- run: yarn test
|
2022-05-20 18:52:57 +02:00
|
|
|
- run: yarn typecheck
|
2022-05-17 20:53:01 +02:00
|
|
|
- run: yarn build
|
2023-01-26 16:16:14 +01:00
|
|
|
|
2022-02-28 13:15:27 +01:00
|
|
|
- name: Download playwright
|
2023-01-26 16:16:14 +01:00
|
|
|
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
|
|
|
|
run: yarn workspace playground run playwright install --with-deps
|
|
|
|
|
2022-02-28 13:15:27 +01:00
|
|
|
- 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 }}
|