-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (41 loc) · 1007 Bytes
/
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:
branches: [trunk]
jobs:
changed-files:
runs-on: ubuntu-latest
outputs:
status: ${{ steps.changed-files.outputs.any_changed }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: changed-files
uses: tj-actions/changed-files@v41
with:
files: |
.github/workflows/test.yml
src/*
test/*
cli.js
package.json
package-lock.json
test:
runs-on: ubuntu-latest
needs: changed-files
if: ${{ needs.changed-files.outputs.status == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache Node
uses: actions/cache@v4
with:
path: |
node_modules
~/.cache
~/.npm
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Test
run: npm test