-
-
Notifications
You must be signed in to change notification settings - Fork 48
53 lines (37 loc) · 1.03 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
45
46
47
48
49
50
51
52
53
name: test
on: [ push, pull_request ]
defaults:
run:
working-directory: action
jobs:
deduplicate:
timeout-minutes: 5
runs-on: ubuntu-latest
# run on external PRs, but on internal PRs as they'll be run by the push to the branch.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- run: echo ::warning ::skipped duplicate run
working-directory: .
audit:
timeout-minutes: 5
needs: deduplicate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2.1.4
- run: npm audit --audit-level=critical
test:
timeout-minutes: 5
needs: audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2.1.4
with:
node-version: 14
- uses: actions/cache@v2.1.4
with:
path: ~/.npm
key: ${{ hashFiles('**/package-lock.json') }}
- run: npm ci
- run: npm run test:ci