-
Notifications
You must be signed in to change notification settings - Fork 5
54 lines (48 loc) · 1.44 KB
/
cypress.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
name: App tests
on:
push:
paths:
- 'app/**'
jobs:
cypress:
runs-on: ubuntu-latest
container: cypress/included:3.8.3
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 100
working-directory: app
- name: Check app path
uses: marceloprado/has-changed-path@v1
id: changed-front
with:
paths: app
- name: Setup node
uses: actions/setup-node@v1
with:
working-directory: app
node-version: '14.21.2'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Yarn cache
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn install
if: steps.yarn-cache.outputs.cache-hit != 'true' # Over here!
run: yarn
- name: Cypress tests
uses: cypress-io/[email protected]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
with:
working-directory: app
build: yarn build
start: yarn start
wait-on: 'http://localhost:3000'