-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (61 loc) · 1.86 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
54
55
56
57
58
59
60
61
62
63
64
name: Test
on:
push:
branches-ignore:
- 'dependabot/**'
env:
CYPRESS_CACHE_FOLDER: cypress/cache
jobs:
test:
runs-on: ubuntu-latest
services:
typesense:
image: typesense/typesense:0.23.1
env:
TYPESENSE_API_KEY: xyz
TYPESENSE_DATA_DIR: /data
TYPESENSE_ENABLE_CORS: true
ports:
- 8108:8108
volumes:
- /tmp/typesense-server-data:/data
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: node_modules/
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Cache functions node_modules
id: cache-functions-node-modules
uses: actions/cache@v2
with:
path: functions/node_modules/
key: functions-node-modules-${{ hashFiles('functions/package-lock.json') }}
- name: Cache firebase emulators
uses: actions/cache@v2
with:
path: ~/.cache/firebase/emulators/
key: firebase-emulators-${{ hashFiles('~/.cache/firebase/emulators/**') }}
- name: Cache cypress binary
uses: actions/cache@v2
with:
path: cypress/cache/
key: cypress-binary-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: Install functions dependencies
if: steps.cache-functions-node-modules.outputs.cache-hit != 'true'
run: npm ci --prefix functions/
- name: Build assets
run: npm run build:ci
- name: Run tests
run: npm run test:cy:ci