-
Notifications
You must be signed in to change notification settings - Fork 10
105 lines (103 loc) · 2.99 KB
/
ci.yaml
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
name: CI
on:
push:
branches: [v9]
pull_request:
branches: [v9]
workflow_call:
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
needs: code-lint
strategy:
fail-fast: false
matrix:
os:
- ubuntu-24.04
- macos-13
- windows-2022
node-version:
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
github.com:443
nodejs.org:443
objects.githubusercontent.com:443
registry.npmjs.org:443
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
if: matrix.node-version != 9
run: npm ci --ignore-scripts
- name: Install Dependencies (Node.js v9)
if: matrix.node-version == 9
run: npm install
- name: Run Tests
if: startsWith(matrix.os, 'windows-')
run: npm test --ignore-scripts
- name: Run Tests (Windows)
if: startsWith(matrix.os, 'windows-')
shell: cmd
run: npm run --ignore-scripts test-windows
- name: Publish Coverage
if: startsWith(matrix.os, 'ubuntu-') && matrix.node-version == 22 # LTS
uses: coverallsapp/github-action@9ba913c152ae4be1327bfb9085dc806cedb44057
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
code-lint:
name: Code Lint
runs-on: ubuntu-24.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
github.com:443
objects.githubusercontent.com:443
registry.npmjs.org:443
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Use Node.js 16
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 22 # LTS
- name: Install Dependencies
run: npm ci --ignore-scripts
- name: Lockfile Lint
run: |
npm exec \
--no-install \
--package=lockfile-lint \
-- \
lockfile-lint \
--allowed-hosts=npm \
--path=./package-lock.json \
--validate-https \
--validate-package-names