-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (41 loc) · 1.22 KB
/
reusable.test.yml
File metadata and controls
49 lines (41 loc) · 1.22 KB
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
name: Test
on:
workflow_call:
secrets:
CODECOV_TOKEN:
required: true
permissions:
contents: read
jobs:
# Test
test:
name: Test
runs-on: ubuntu-latest
steps:
# Harden Runner
- name: Harden Runner # Audit all outbound calls
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
# Checkout
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 2 # At least fetch the last two commits for comparison
persist-credentials: false
# Setup Node
- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: lts/*
# Clean Install
- name: Clean Install
run: npm ci
# Run Test and Generate Coverage
- name: Run Test and Generate Coverage
run: npm test
# Upload Coverage Reports to Codecov
- name: Upload Coverage Reports to Codecov
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
with:
token: ${{ secrets.CODECOV_TOKEN }}