-
Notifications
You must be signed in to change notification settings - Fork 10
57 lines (46 loc) · 1.42 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
55
56
57
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
all:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
# https://docs.github.com/en/free-pro-team@latest/actions/guides/caching-dependencies-to-speed-up-workflows
- name: Reuse npm cache folder
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# reuse the npm-cache and some node_modules folders
path: |
~/.npm
./node_modules
# invalidate cache when any package.json changes
key: ${{ runner.os }}-npm-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-${{ env.cache-name }}-
${{ runner.os }}-npm-
${{ runner.os }}-
# install
- name: install node modules
run: npm install --legacy-peer-deps
- run: npm run build
- run: npm run test:node
- name: test browser
uses: GabrielBB/xvfb-action@v1
with:
working-directory: ./ #optional
run: npm run test:browser
- name: test:tryings
run: npm run test:typings
- name: lint
run: npm run lint