-
Notifications
You must be signed in to change notification settings - Fork 14
59 lines (48 loc) · 1.96 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
52
53
54
55
56
57
58
59
name: Tests
on: [push, pull_request]
jobs:
e2e-and-unit:
runs-on: ubuntu-16.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Reconfigure git to use HTTP authentication
run: >
git config --global url."https://github.com/".insteadOf
ssh://[email protected]/
- name: Run our Cypress E2E tests
uses: cypress-io/github-action@v2
with:
# Passing environment variables here will pass them as Cypress Environment Variables (https://docs.cypress.io/guides/guides/environment-variables.html), and will not be accessible to the start script
# env: DATABASE_URL=${{ secrets.DATABASE_URL }}
start: npm start
wait-on: "http://localhost:3000"
wait-on-timeout: 120
record: ${{ contains(github.event_name, 'push') }}
env:
# These environment variables will be picked up by the start script
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
REACT_APP_INFURA_ID: ${{ secrets.REACT_APP_INFURA_ID }}
REACT_APP_ALCHEMY_ID: ${{ secrets.REACT_APP_ALCHEMY_ID }}
REACT_APP_PORTIS_ID: ${{ secrets.REACT_APP_PORTIS_ID }}
REACT_APP_FORTMATIC_KEY: ${{ secrets.REACT_APP_FORTMATIC_KEY }}
- name: Run unit tests with coverage
run: npm run unit-test
env:
CI: true
- name: Merge our test reports
run: npx merge-cypress-jest-coverage
- name: Upload coverage report to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }} # This is passed by Github, don't worry about setting this.
- name: Report the bundle size of this build
uses: sarthak-saxena/JSBundleSize@master
with:
build_command: npm run build
dist_path: "build"
token: ${{ secrets.GITHUB_TOKEN }}
env:
CI: false