-
Notifications
You must be signed in to change notification settings - Fork 1.4k
98 lines (94 loc) · 2.71 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
90
91
92
93
94
95
96
97
98
name: Install and test AVA
on:
push:
branches:
- main
pull_request:
paths-ignore:
- "*.md"
- "docs/**"
- "media/**"
jobs:
nodejs:
name: Node.js
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version: [^16.18, ^18.16, ^20.3]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: Enable symlinks
if: matrix.os == 'windows-latest'
run: |
git config core.symlinks true
git reset --hard
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm install --no-audit
- run: npm run cover
- uses: codecov/codecov-action@v3
with:
files: coverage/lcov.info
name: ${{ matrix.os }}/${{ matrix.node-version }}
typescript:
name: TypeScript compatibility
runs-on: ubuntu-latest
strategy:
matrix:
ts-version: [~4.7, ~4.8, ~4.9, ~5.0]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: package.json
cache: npm
- run: npm install --no-audit
- run: npm i typescript@${TS_VERSION}
env:
TS_VERSION: ${{ matrix.ts-version }}
- run: ./node_modules/typescript/bin/tsc --version
- run: ./node_modules/typescript/bin/tsc --noEmit
lockfile_churn:
name: Test package-lock for unexpected modifications
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: package.json
cache: npm
- run: npm install --no-audit
- name: Test package-lock for unexpected modifications
run: |
npm -v
checksum=$(sha512sum package-lock.json)
npm install --package-lock-only --no-audit
if ! echo ${checksum} | sha512sum --quiet -c -; then
echo "package-lock.json was modified unexpectedly. Please rebuild it using npm@$(npm -v) and commit the changes."
exit 1
fi
without_lockfile:
name: Install dependencies without using a lockfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: package.json
- run: npm install --no-package-lock --no-audit
- run: npm run cover
xo:
name: Lint source files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: package.json
cache: npm
- run: npm install --no-audit
- run: npx xo