-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (36 loc) · 1.05 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
43
44
name: Test
on:
pull_request:
types: [opened, synchronize]
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'
- name: Cache Node npm
id: cache-nodemodules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-infrastructure-templates-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-infrastructure-templates
- name: Install modules
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: npm ci
- name: Run tests
shell: bash
run: npm run test '--ignore-scripts' -- --coverage --ci
- name: Upload test coverage
uses: actions/upload-artifact@v4
with:
name: jest-coverage
path: coverage/coverage-final.json
retention-days: 3