Skip to content

Commit f07d417

Browse files
Gido Mandersclaude
andcommitted
chore: modernize GitHub Actions workflow
- Update Node.js matrix from 16/18/20 to 20/22/24 (active LTS versions) - Bump all actions to v4 (checkout, setup-node, upload/download-artifact) - Bump codecov-action from v3 to v5 with token support - Replace separate cache action with setup-node built-in caching - Use npm ci instead of npm install for reproducible builds - Replace timezone action with TZ environment variable - Scope triggers to master branch and add pull_request trigger Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4fc0950 commit f07d417

1 file changed

Lines changed: 19 additions & 27 deletions

File tree

.github/workflows/workflow.yml

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,36 @@
11
name: Node.js CI
22

3-
on: [push]
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
48

59
jobs:
610
build:
711
runs-on: ubuntu-latest
812

913
strategy:
1014
matrix:
11-
node-version: [16.x, 18.x, 20.x]
15+
node-version: [20, 22, 24]
16+
17+
env:
18+
TZ: Europe/Amsterdam
1219

1320
steps:
14-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
1522
- name: Use Node.js ${{ matrix.node-version }}
16-
uses: actions/setup-node@v3
23+
uses: actions/setup-node@v4
1724
with:
1825
node-version: ${{ matrix.node-version }}
19-
- uses: actions/cache@v3
20-
with:
21-
path: ~/.npm
22-
key: ${{ runner.os }}-${{ matrix.node-version }}-node-${{ hashFiles('**/package-lock.json') }}
23-
restore-keys: |
24-
${{ runner.os }}-${{ matrix.node-version }}-node-
25-
${{ runner.os }}-node-
26-
${{ runner.os }}-
27-
- name: Setup timezone
28-
uses: zcong1993/setup-timezone@v1.1.2
29-
with:
30-
timezone: Europe/Amsterdam
31-
- run: npm install
26+
cache: npm
27+
- run: npm ci
3228
- run: npm run lint
3329
- run: npm run test:ts
3430
- run: npm run test:coverage
3531
- run: npm run tsc
36-
env:
37-
CI: true
38-
- uses: actions/upload-artifact@v3
39-
if: matrix.node-version == '20.x'
32+
- uses: actions/upload-artifact@v4
33+
if: matrix.node-version == 24
4034
with:
4135
path: ./coverage
4236
name: code-coverage
@@ -46,17 +40,15 @@ jobs:
4640
runs-on: ubuntu-latest
4741

4842
steps:
49-
- uses: actions/checkout@v3
50-
- uses: actions/download-artifact@v3
43+
- uses: actions/checkout@v4
44+
- uses: actions/download-artifact@v4
5145
with:
5246
name: code-coverage
5347
path: ./coverage
5448
- name: Upload coverage to Codecov
55-
uses: codecov/codecov-action@v3
49+
uses: codecov/codecov-action@v5
5650
with:
51+
token: ${{ secrets.CODECOV_TOKEN }}
5752
directory: ./coverage
5853
flags: unittests
59-
name: codecov-umbrella
6054
fail_ci_if_error: true
61-
path_to_write_report: ./coverage/codecov_report.txt
62-
verbose: true

0 commit comments

Comments
 (0)