Skip to content

Commit 25d8128

Browse files
committed
Update CI.
1 parent e6934d7 commit 25d8128

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
dist
22
node_modules
33
/test/fixture
4+
scripts/docs.ts

.github/workflows/ci.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,16 @@ jobs:
44
build:
55
name: Build
66
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
node: ["12", "14", "16"]
710
steps:
811
- uses: actions/checkout@v2
912
- uses: actions/setup-node@v2
1013
with:
11-
node-version: "14"
12-
13-
- name: Get yarn cache directory path
14-
id: yarn-cache-dir-path
15-
run: echo "::set-output name=dir::$(yarn cache dir)"
16-
- uses: actions/cache@v2
17-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
18-
with:
19-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
20-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
21-
restore-keys: |
22-
${{ runner.os }}-yarn-
23-
14+
node-version: ${{ matrix.node }}
15+
cache: "yarn"
2416
- run: yarn
2517
- run: yarn build
26-
- run: yarn run eslint
18+
- run: yarn lint
2719
- run: yarn test:all

scripts/docs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const formatLevel = (options) => {
2828
"0": "off",
2929
"1": "a warning",
3030
"2": "an error",
31+
off: "off",
3132
warn: "a warning",
3233
error: "an error",
3334
}[options];
@@ -101,7 +102,7 @@ const buildCases = (content, filename) => {
101102
if (!cases) {
102103
return content;
103104
}
104-
const valid = cases.valid.map((c) => (typeof c === "string" ? { code: c } : c)) ?? [];
105+
const valid = cases.valid?.map((c) => (typeof c === "string" ? { code: c } : c)) ?? [];
105106
const invalid = cases.invalid ?? [];
106107

107108
const markdown = [

0 commit comments

Comments
 (0)