-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (60 loc) · 1.89 KB
/
testing-client.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
name: Client Tests
on:
push:
paths:
- 'client/**'
- '.github/workflows/testing-client.yml'
workflow_dispatch:
env:
NODE_ENV: production
jobs:
testing-client:
name: Running client tests
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
fail-fast: false
defaults:
run:
working-directory: ${{github.workspace}}/client
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js 18.13
uses: actions/setup-node@v3
with:
node-version-file: 'client/.nvmrc'
cache: 'yarn'
cache-dependency-path: client/yarn.lock
- name: Install dependencies
run: yarn install --immutable
- name: Cypress run
uses: cypress-io/github-action@v5
with:
record: true
working-directory: client
install: false
build: yarn build
start: yarn start
browser: chrome
wait-on: http://localhost:3000/auth/signin
config-file: cypress.config.ts
command-prefix: yarn dlx
command: "yarn test:e2e"
env:
NEXT_PUBLIC_MAPBOX_API_TOKEN: ${{ secrets.NEXT_PUBLIC_MAPBOX_API_TOKEN }}
NEXT_PUBLIC_API_URL: ${{ secrets.CYPRESS_API_URL }}
NEXT_TELEMETRY_DISABLED: 1
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: nyanpony
CYPRESS_USERNAME: ${{ secrets.CYPRESS_USERNAME }}
CYPRESS_PASSWORD: ${{ secrets.CYPRESS_PASSWORD }}
CYPRESS_API_URL: ${{ secrets.CYPRESS_API_URL }}
# pass GitHub token to detect new build vs re-run build
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
DEBUG: "cypress:server:args"
- uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: ${{github.workspace}}/client/cypress/screenshots