Skip to content

Commit db29653

Browse files
committed
chore(ci): update workflow
Made a few updates to the CI: 1. Don't duplicate the task on both push and PR (i.e., one or the other) 2. Update the node versions to no longer test against deprecated versions, and add new versions in. 3. Added caching to help CI speed. 4. Rename the workflow to `test`, and allowed it to be extended to reuire other steps (e.g., linting in the future). Signed-off-by: JP-Ellis <josh@jpellis.me>
1 parent f60b4a0 commit db29653

File tree

2 files changed

+57
-36
lines changed

2 files changed

+57
-36
lines changed

.github/workflows/node.js.yml

-36
This file was deleted.

.github/workflows/test.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: test
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches:
10+
- main
11+
pull_request:
12+
branches:
13+
- main
14+
15+
jobs:
16+
complete:
17+
name: Test completion check
18+
if: always()
19+
20+
permissions:
21+
contents: none
22+
23+
runs-on: ubuntu-latest
24+
needs:
25+
- test
26+
27+
steps:
28+
- name: Failed
29+
run: exit 1
30+
if: >
31+
contains(needs.*.result, 'failure')
32+
|| contains(needs.*.result, 'cancelled')
33+
|| contains(needs.*.result, 'skipped')
34+
35+
test:
36+
runs-on: ${{ matrix.os }}
37+
38+
defaults:
39+
run:
40+
shell: bash
41+
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
node-version: [18, 20, 22]
46+
os: [ubuntu-latest, macos-latest, windows-latest]
47+
48+
steps:
49+
- uses: actions/checkout@v4
50+
51+
- name: Use Node.js ${{ matrix.node-version }}
52+
uses: actions/setup-node@v4.1.0
53+
with:
54+
node-version: ${{ matrix.node-version }}
55+
cache: npm
56+
57+
- run: ./scripts/ci/test.sh

0 commit comments

Comments
 (0)