-
Notifications
You must be signed in to change notification settings - Fork 5
63 lines (52 loc) · 1.66 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
name: Unit and E2E Tests
on: [push]
jobs:
Jest:
name: Jest Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: ${{ env.NODE_VERSION }}
# - name: Set up Node.js
# uses: actions/setup-node@v2
# with:
# node-version: '14' # specify the node version
# - name: Cache dependencies
# uses: actions/cache@v2
# with:
# path: ~/.cache/yarn
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile # Use frozen-lockfile to ensure reproducibility.
- name: Run Tests
run: yarn test
cypress-run:
name: Cypress E2E Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build
env:
CI: false
run: yarn build
- name: Cypress run
uses: cypress-io/github-action@v5
env:
REACT_APP_DESCOPE_PROJECT_ID: ${{ secrets.REACT_APP_DESCOPE_PROJECT_ID }}
REACT_APP_DESCOPE_MANAGEMENT_KEY: ${{ secrets.REACT_APP_DESCOPE_MANAGEMENT_KEY }}
# pass GitHub token to detect new build vs re-run build
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
start: yarn start
wait-on: "http://localhost:3000"
wait-on-timeout: 120
browser: chrome
# record: true