-
-
Notifications
You must be signed in to change notification settings - Fork 141
74 lines (68 loc) · 1.81 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
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
test:
name: Test on node ${{ matrix.node }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
node: [20, 22]
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
registry-url: https://registry.npmjs.org
- name: Cache npm
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Cache jest
uses: actions/cache@v1
with:
path: .jest-cache
key: ${{ runner.os }}-${{ matrix.node-version }}-jest
- name: install
run: npm ci
- name: lint
run: npm run lint
- name: build
run: npm run build
- name: install chromium
run: npm run chromium
- name: install package revision
run: npm i . -g
- name: test
run: npm test
env:
FORCE_EXIT: true
- name: upload visual diff
uses: actions/upload-artifact@v3
if: failure()
with:
name: visual-test-diff-${{ runner.os }}-${{ matrix.node }}
path: temp/diff/*
commit-lint:
runs-on: ubuntu-latest
steps:
- uses: ahmadnassri/action-commit-lint@v1
auto-merge:
if: ${{ false }}
needs: test
runs-on: ubuntu-latest
steps:
- uses: fastify/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
merge-method: rebase