-
Notifications
You must be signed in to change notification settings - Fork 282
54 lines (54 loc) · 1.64 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: PR Tests
on:
pull_request:
workflow_dispatch:
concurrency:
group: primary-tests-${{ github.head_ref }}
cancel-in-progress: true
env:
NODE_OPTIONS: --max-old-space-size=4096
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- 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 project dependencies
run: yarn --prefer-offline
- name: Jest Tests
run: yarn jest
- name: Build static site
run: yarn build
- name: Serve and Check Links
# Looks weird, but this works significantly better than running it
# through a single node process
run: yarn run serve & (sleep 5 && yarn run links:internal)
- name: Cypress run
uses: cypress-io/github-action@v2
with:
start: yarn serve
wait-on: "http://localhost:8080"
- uses: actions/upload-artifact@v2
with:
name: cypress-screenshots
path: cypress/screenshots
if-no-files-found: ignore
- uses: actions/upload-artifact@v2
with:
name: cypress-videos
path: cypress/videos
if-no-files-found: ignore