-
Notifications
You must be signed in to change notification settings - Fork 10
49 lines (41 loc) · 1.2 KB
/
reusable-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
43
44
45
46
47
48
49
# Our reusable workflow files only use the `workflow_call` event and don't
# specify a `concurrency` limit so those things can be managed by the caller.
name: Reusable test workflow
on: [workflow_call]
jobs:
test:
name: "Run tests (OS: ${{matrix.os}}, Node: ${{ matrix.node }})"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node: [18, 20]
os: [ubuntu-latest]
permissions:
contents: read
steps:
# Environment security
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
github.com:443
registry.npmjs.org:443
# Checkout
# Most toolchains require checkout first
- name: Checkout
uses: actions/checkout@v4
# Language toolchains
- name: Install Node
uses: actions/[email protected]
with:
node-version: ${{ matrix.node }}
# Workflow
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Run tests
run: npm test