Skip to content

Commit c071d9c

Browse files
committed
feat(workflows): feat(workflows): create 'test.yml' reusable workflow
1 parent ec0a8f8 commit c071d9c

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Test
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
node_versions:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
test_matrix:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node_version:
16+
- 14
17+
- 16
18+
- 18
19+
steps:
20+
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
21+
- name: "Test with Node.js ${{ matrix.node_version }}"
22+
uses: actions/setup-node@5b949b50c3461bbcd5a540b150c368278160234a # tag=v3
23+
with:
24+
node-version: "${{ matrix.node_version }}"
25+
cache: npm
26+
- run: npm ci
27+
- run: npm run test --ignore-scripts # run lint only once
28+
test:
29+
runs-on: ubuntu-latest
30+
needs: test_matrix
31+
steps:
32+
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3
33+
- run: npm ci
34+
- run: npm run lint --if-present

0 commit comments

Comments
 (0)