Skip to content

Commit fa26ea2

Browse files
Gido Mandersclaude
andcommitted
chore: Modernize GitHub Actions workflow
Update Node matrix to active LTS versions (20, 22, 24), upgrade all actions to latest majors, use built-in npm caching, and add PR trigger for protected branch checks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0aa55a0 commit fa26ea2

1 file changed

Lines changed: 24 additions & 27 deletions

File tree

.github/workflows/workflow.yml

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,35 @@
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:
7-
811
runs-on: ubuntu-latest
912

1013
strategy:
1114
matrix:
12-
node-version: [14.x, 16.x, 18.x]
15+
node-version: [20, 22, 24]
1316

1417
steps:
15-
- uses: actions/checkout@v2
16-
- name: Use Node.js ${{ matrix.node-version }}
17-
uses: actions/setup-node@v1
18-
with:
19-
node-version: ${{ matrix.node-version }}
20-
- uses: actions/cache@v2
21-
with:
22-
path: ~/.npm
23-
key: ${{ runner.os }}-${{ matrix.node-version }}-node-${{ hashFiles('**/package-lock.json') }}
24-
restore-keys: |
25-
${{ runner.os }}-node-
26-
- run: npm install
27-
- run: npm run test
28-
env:
29-
CI: true
30-
- name: Upload coverage to Codecov
31-
uses: codecov/codecov-action@v1
32-
with:
33-
directory: ./coverage
34-
flags: unittests
35-
name: codecov-umbrella
36-
fail_ci_if_error: true
37-
path_to_write_report: ./coverage/codecov_report.txt
38-
verbose: true
18+
- uses: actions/checkout@v4
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
cache: npm
24+
- run: npm ci
25+
- run: npm test
26+
env:
27+
CI: true
28+
- name: Upload coverage to Codecov
29+
if: matrix.node-version == 24
30+
uses: codecov/codecov-action@v5
31+
with:
32+
token: ${{ secrets.CODECOV_TOKEN }}
33+
directory: ./coverage
34+
flags: unittests
35+
fail_ci_if_error: true

0 commit comments

Comments
 (0)