-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (71 loc) · 2.02 KB
/
node.js.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js Build CI
env:
NODE_VERSION: 16.14.2
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{env.NODE_VERSION}}
cache: "yarn"
- name: yarn build
run: |
yarn install --immutable
yarn build
- name: store build artifact
uses: actions/upload-artifact@v3
with:
name: build
path: build
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Lint with eslint
uses: actions/setup-node@v3
with:
node-version: ${{env.NODE_VERSION}}
cache: "yarn"
- name: yarn lint
run: |
yarn install --immutable
yarn eslint . --ext .js,.jsx,.ts,.tsx
vitest_tests:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
yarn install --immutable
yarn test:vitest
cypress_tests:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
browser: [chrome, firefox, edge]
container:
image: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
options: --user 1001
steps:
- uses: actions/checkout@v3
- name: Download the build folders
uses: actions/download-artifact@v3
with:
name: build
path: build
- uses: cypress-io/github-action@v4
with:
browser: ${{ matrix.browser }}
build: yarn build