-
Notifications
You must be signed in to change notification settings - Fork 165
68 lines (59 loc) · 2.33 KB
/
main.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
65
66
67
68
name: Main Commit Checks
on: [push]
jobs:
build:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
runs-on: macos-latest
strategy:
matrix:
# The node version, you can put one or many versions in here to test with
node: [16.x]
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
# This should be caching node modules, hashing the cache key with the yarn lock code and busting that when yarn lock changes
- name: cache modules
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: sudo npm install -g yarn
- name: Create .npmrc
run: echo '//registry.npmjs.org/:_authToken= ${{ secrets.NPM_TOKEN }}' >> .npmrc
- run: yarn install --network-timeout 1000000
env:
CYPRESS_CACHE_FOLDER: ~/.cache/Cypress
- name: linting
run: yarn run lint
- name: jest-run
run: yarn test
- name: cypress-run
uses: cypress-io/github-action@v2
env:
USE_HTTP: true
with:
start: yarn serve --mode e2e
wait-on: 'http://localhost:5000/'
# wait for 3 minutes for the server to respond
wait-on-timeout: 300
browser: chrome
headless: true
# These extract all artifacts out from the container to git so they can be previewed
- name: extract screenshots to git
uses: actions/upload-artifact@v2
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
# Test run video was always captured, so this action uses "always()" condition
- name: extract videos to git
uses: actions/upload-artifact@v2
if: always()
with:
name: cypress-videos
path: cypress/videos