-
Notifications
You must be signed in to change notification settings - Fork 64
57 lines (46 loc) · 1.83 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
name: Tests
on: [push, pull_request]
jobs:
e2e-and-unit:
runs-on: ubuntu-latest
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://git@github.com/
- 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_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