-
-
Notifications
You must be signed in to change notification settings - Fork 8
42 lines (39 loc) · 1.12 KB
/
test.yml
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
name: Test
on:
push:
branches:
- main
pull_request:
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
nodes: ${{ steps.nodes.outputs.nodes }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- name: Setup Node Version Matrix
id: nodes
run: |
NODES=$(npx -y @pkgjs/nv ls supported | jq '. | .version' | paste -sd "," -)
echo "nodes=[${NODES}]" >> $GITHUB_OUTPUT
test:
# uses: pkgjs/action/.github/workflows/node-test.yaml@v0
runs-on: ubuntu-latest
needs: setup
strategy:
matrix:
node-version: ${{ fromJson(needs.setup.outputs.nodes) }}
steps:
- uses: actions/checkout@v4
- name: Setup git user
run: |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: npm install and test
run: npm it