114 lines (110 loc) 路 3.14 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
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: [^12.22, ^14.17, ^16.4, ^17]
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Enable symlinks
if: matrix.os == 'windows-latest'
run: |
git config core.symlinks true
git reset --hard
- run: rm .npmrc
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Upgrade npm
run: npm install --global npm@^8.1.2
- run: npm install --no-audit
- run: npm run cover
- uses: codecov/codecov-action@v2
with:
files: coverage/lcov.info
name: ${{ matrix.os }}/${{ matrix.node-version }}
typescript:
name: TypeScript compatibility
runs-on: ubuntu-latest
strategy:
matrix:
ts-version: [~4.4, ~4.5, ~4.6, ~4.7]
steps:
- uses: actions/checkout@v2
- run: rm .npmrc
- uses: actions/setup-node@v2
with:
node-version: ^12.22
cache: npm
- name: Upgrade npm
run: npm install --global npm@^8.1.2
- run: npm install --no-audit
- run: npm i typescript@${TS_VERSION}
env:
TS_VERSION: ${{ matrix.ts-version }}
- run: npm ls typescript
continue-on-error: true
- run: npx tsd
lockfile_churn:
name: Test package-lock for unexpected modifications
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rm .npmrc
- uses: actions/setup-node@v2
with:
node-version: ^12.22
cache: npm
- name: Upgrade npm
run: if [[ "$(npm -v)" != "8.1.2" ]]; then npm install --global npm@8.1.2; fi
- run: npm install --no-audit --lockfile-version=3
- name: Test package-lock for unexpected modifications
run: |
npm -v
checksum=$(md5sum package-lock.json)
npm install --package-lock-only --no-audit
if ! echo ${checksum} | md5sum --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@v2
- run: rm .npmrc
- uses: actions/setup-node@v2
with:
node-version: ^12.22
- name: Upgrade npm
run: npm install --global npm@^8.1.2
- run: npm install --no-shrinkwrap --no-audit
- run: npm run cover
xo:
name: Lint source files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rm .npmrc
- uses: actions/setup-node@v2
with:
node-version: ^16.4
cache: npm
- name: Upgrade npm
run: npm install --global npm@^8.1.2
- run: npm install --no-audit
- run: npx xo