-
Notifications
You must be signed in to change notification settings - Fork 44
76 lines (66 loc) · 1.95 KB
/
tests.yaml
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
name: Tests
on:
pull_request:
push:
branches: [main]
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm install
- name: Run Jest tests
uses: willcaul/jest-github-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
test-command: 'npm run test:jest'
e2e-tests-chrome:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cypress run (Chrome)
uses: cypress-io/github-action@v6
env:
APP_ENV: ${{ secrets.TESTING_APP_ENV }}
AF_DB_URL: ${{ secrets.STAGING_AF_DB_URL }}
AF_BEARER_TOKEN: ${{ secrets.STAGING_AF_BEARER_TOKEN }}
with:
build: npm run build
start: npm run start
wait-on: 'http://localhost:3000'
browser: chrome
e2e-tests-firefox:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cypress run (Firefox)
uses: cypress-io/github-action@v6
env:
APP_ENV: ${{ secrets.TESTING_APP_ENV }}
AF_DB_URL: ${{ secrets.STAGING_AF_DB_URL }}
AF_BEARER_TOKEN: ${{ secrets.STAGING_AF_BEARER_TOKEN }}
with:
build: npm run build
start: npm run start
wait-on: 'http://localhost:3000'
browser: firefox