-
Notifications
You must be signed in to change notification settings - Fork 63
89 lines (77 loc) · 2.55 KB
/
ci.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
84
85
86
87
88
89
name: CI
on:
push:
branches:
- 'master'
pull_request:
jobs:
test:
name: Lint & Test
runs-on: ubuntu-latest
env:
CI: true
strategy:
matrix:
node: [18]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup environment
id: setup
run: |-
echo "npm-cache-dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- name: Setup Node ${{ matrix.node }}
uses: actions/setup-node@master
with:
node-version: ${{ matrix.node }}
check-latest: true
# TODO: this does work (it'll find the cache) but it appears it's not putting the cache
# back into ./node_modules because skipping the install step results in subsequent
# steps failing with messages like `prettier not found`, which implies there's no
# node_modules directory there with Prettier installed in it...
#
# - name: NPM cache check
# uses: actions/cache@v3
# id: npm-cache
# with:
# path: ${{ steps.setup.outputs.npm-cache-dir }}
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-
- name: Install packages
# if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- name: Lint
run: |-
npm run format:check;
npm run lint;
- name: Test
run: |-
npm run test:coverage;
npm run test:types;
- name: Upload coverage to Codecov
# https://github.com/marketplace/actions/codecov
uses: codecov/codecov-action@v2
- name: Build # Tests to see if a build can succeed
run: npm run build
e2e:
runs-on: ubuntu-22.04
strategy:
matrix:
browser: [chrome, firefox]
timeout-minutes: 20
container:
# https://hub.docker.com/r/cypress/browsers/tags
# NOTE: at least Chrome 102 is required for testing `inert` attribute support
image: cypress/browsers:node18.12.0-chrome106-ff106
options: --user 1001 --shm-size=2g # @see https://github.com/cypress-io/github-action/issues/104#issuecomment-666047965
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Test E2E
# https://github.com/cypress-io/github-action
# https://github.com/cypress-io/code-coverage
uses: cypress-io/github-action@v5 # will run all tests found per cypress.config.js
with:
start: npm run start
browser: ${{ matrix.browser }}