-
Notifications
You must be signed in to change notification settings - Fork 319
41 lines (34 loc) · 980 Bytes
/
tests.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
name: Tests
on: [push, pull_request]
jobs:
run-tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
id: npm-cache
with:
key: npm-cache-${{ hashFiles('package-lock.json') }}
path: node_modules
- name: Cache tasks
uses: actions/cache@v3
with:
key: task-cache
path: |
.cache/eslint
.cache/stylelint
- name: Setup Node.js
uses: actions/setup-node@v3
with:
cache: ${{ steps.npm-cache.outputs.cache-hit != 'true' && 'npm' || '' }}
node-version-file: .nvmrc
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- name: Run tests
run: npx percy exec -- npm test
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}