-
Notifications
You must be signed in to change notification settings - Fork 61
119 lines (114 loc) · 3.59 KB
/
ci.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.15.0"
cache: "npm"
# fix for forcing git to use https when pulling deps
- run: 'git config --global --replace-all url."https://github.com/".insteadOf ssh://[email protected]/'
- run: npm ci
- run: npm run build --if-present
- name: Run BundleMon
run: npm run bundlemon
env:
BUNDLEMON_PROJECT_ID: 62325f451d1b50bea48f41fb
CI_COMMIT_SHA: ${{github.event.pull_request.head.sha || github.sha}} # important!
# Keeping in case we ever want to save build artifacts
# - name: Zip artifact
# run: zip build-artifact -r ./build
# - uses: actions/upload-artifact@v3
# with:
# name: build-artifact
# path: ./build-artifact.zip
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.15.0"
cache: "npm"
# fix for forcing git to use https when pulling deps
- run: 'git config --global --replace-all url."https://github.com/".insteadOf ssh://[email protected]/'
- run: npm ci
- run: npm run lint
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.15.0"
cache: "npm"
# fix for forcing git to use https when pulling deps
- run: 'git config --global --replace-all url."https://github.com/".insteadOf ssh://[email protected]/'
- run: npm ci
- run: npm test
env:
CI: true
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.15.0"
# fix for forcing git to use https when pulling deps
- run: 'git config --global --replace-all url."https://github.com/".insteadOf ssh://[email protected]/'
- run: npm ci
- run: npm test -- --coverage
env:
CI: true
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
coverage-cypress:
env:
REACT_APP_NOTIFY_DAPP_ID: ${{ secrets.REACT_APP_NOTIFY_DAPP_ID }}
runs-on: ubuntu-latest
services:
saddle-contract:
image: saddlefinance/contracts:latest
ports:
- 8545:8545
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "16.15.0"
cache: "npm"
- name: Cache Cypress
id: cache-cypress
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
# - uses: actions/download-artifact@v2
# with:
# name: build-artifact
# - name: Unzip artifact
# run: unzip -qq build-artifact.zip -d .
# fix for forcing git to use https when pulling deps
- run: 'git config --global --replace-all url."https://github.com/".insteadOf ssh://[email protected]/'
- run: npm ci
- run: npm run cy:coverage
env:
CHOKIDAR_USEPOLLING: 1
- run: npx nyc report --reporter=text
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- uses: actions/upload-artifact@v3
if: failure()
with:
name: E2E Failures
path: cypress/screenshots/