-
Notifications
You must be signed in to change notification settings - Fork 319
51 lines (42 loc) · 1.36 KB
/
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
42
43
44
45
46
47
48
49
50
51
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/jest
.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: Build assets
run: npm run build:assets
- name: Run test projects
run: |
npx jest --color --selectProjects "Nunjucks macro tests"
npx jest --color --selectProjects "JavaScript unit tests"
npx jest --color --selectProjects "JavaScript behaviour tests"
- name: Send screenshots to Percy
run: npx percy exec -- jest --color --selectProjects "JavaScript component tests"
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}