Skip to content

Commit a6f459b

Browse files
committed
1 parent 9f9baf3 commit a6f459b

File tree

3 files changed

+1603
-23
lines changed

3 files changed

+1603
-23
lines changed

.github/workflows/continuous-integration.yml

+68-23
Original file line numberDiff line numberDiff line change
@@ -9,66 +9,111 @@ on:
99
schedule:
1010
- cron: '0 2 * * 1' # At 02:00 on Monday
1111

12-
env:
13-
NODE_OPTIONS: --max-old-space-size=4096
12+
permissions: {}
1413

1514
jobs:
1615
test:
1716
name: Test
18-
timeout-minutes: 15
17+
timeout-minutes: 5
1918
strategy:
2019
matrix:
2120
os: [ubuntu-latest]
22-
node-version: [16, 18]
21+
node-version:
22+
- 16
23+
- 18
24+
- 20
25+
- 21
2326
include:
2427
- os: macos-latest
25-
node-version: 16 # LTS
28+
node-version: 20 # LTS
29+
- os: windows-latest
30+
node-version: 20 # LTS
2631
fail-fast: false
2732
runs-on: ${{ matrix.os }}
2833
steps:
29-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
34+
- uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
35+
if: ${{ matrix.os == 'ubuntu-latest' }}
3036
with:
31-
fetch-depth: 0
37+
disable-sudo: true
38+
egress-policy: block
39+
allowed-endpoints: >
40+
api.github.com:443
41+
github.com:443
42+
nodejs.org:443
43+
registry.npmjs.org:443
44+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3245
- name: Use Node.js ${{ matrix.node-version }}
33-
uses: actions/setup-node@v3
46+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
3447
with:
3548
node-version: ${{ matrix.node-version }}
49+
cache: npm
3650
- name: Bootstrap project
37-
run: |
38-
npm ci --ignore-scripts
39-
- uses: Yuri6037/[email protected]
51+
run: npm ci --ignore-scripts --prefer-offline
52+
- uses: Yuri6037/Action-FakeTTY@1abc69c7d530815855caedcd73842bae5687c1a6 # v1.1
4053
- name: Run tests
4154
run: faketty npm test --ignore-scripts
4255

4356
code-lint:
4457
name: Code Lint
4558
runs-on: ubuntu-latest
4659
steps:
47-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
48-
- name: Use Node.js 16
49-
uses: actions/setup-node@v3
60+
- uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
61+
with:
62+
disable-sudo: true
63+
egress-policy: block
64+
allowed-endpoints: >
65+
api.github.com:443
66+
github.com:443
67+
nodejs.org:443
68+
registry.npmjs.org:443
69+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
70+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
71+
- name: Use Node.js 20
72+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
5073
with:
51-
node-version: 16
74+
node-version: 20
75+
cache: 'npm'
5276
- name: Bootstrap project
5377
run: |
54-
npm ci --ignore-scripts
78+
npm ci \
79+
--ignore-scripts \
80+
--prefer-offline
5581
- name: Verify code linting
56-
run: npm run lint
82+
run: npm run lint --ignore-scripts
5783

5884
commit-lint:
5985
name: Commit Lint
6086
runs-on: ubuntu-latest
6187
if: ${{ github.event.pull_request }}
6288
steps:
63-
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
89+
- uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
90+
with:
91+
disable-sudo: true
92+
egress-policy: block
93+
allowed-endpoints: >
94+
github.com:443
95+
registry.npmjs.org:443
96+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6497
with:
6598
fetch-depth: 0
66-
- name: Use Node.js 16
67-
uses: actions/setup-node@v3
99+
- name: Use Node.js 20
100+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
68101
with:
69-
node-version: 16
102+
node-version: 20
103+
cache: npm
70104
- name: Bootstrap project
71105
run: |
72-
npm ci --ignore-scripts
106+
npm ci \
107+
--ignore-scripts \
108+
--prefer-offline
73109
- name: Verify commit linting
74-
run: npx commitlint --from origin/master --to HEAD --verbose
110+
run: |
111+
npm exec \
112+
--no-install \
113+
--package=@commitlint/cli \
114+
-- \
115+
commitlint \
116+
--from=origin/master \
117+
--to=HEAD \
118+
--verbose
119+

0 commit comments

Comments
 (0)