-
Notifications
You must be signed in to change notification settings - Fork 12
48 lines (42 loc) · 1.41 KB
/
cypress-tests.yml
File metadata and controls
48 lines (42 loc) · 1.41 KB
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
name: Cypress Tests
on:
pull_request:
branches:
- main
paths:
- "next/**/*"
- ".github/workflows/cypress-tests.yaml"
jobs:
cypress-run:
name: Cypress E2E Tests
runs-on: ubuntu-latest
environment: staging
env:
NEXT_PUBLIC_API_URL: ${{ vars.NEXT_PUBLIC_API_URL }}
NEXT_PUBLIC_SITE_NAME: ${{ vars.NEXT_PUBLIC_SITE_NAME }}
NEXT_PUBLIC_KEY_STRIPE: ${{ secrets.NEXT_PUBLIC_KEY_STRIPE }}
NEXT_PUBLIC_BASE_URL_FRONTEND: ${{ vars.NEXT_PUBLIC_BASE_URL_FRONTEND }}
NODE_ENV: ${{ vars.NODE_ENV }}
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:staging
CRYPRESS_AUTH_EMAIL: ${{ secrets.CRYPRESS_AUTH_EMAIL }}
CRYPRESS_AUTH_PASSWORD: ${{ secrets.CRYPRESS_AUTH_PASSWORD }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
cache-dependency-path: 'next/package-lock.json'
- name: Install dependencies
working-directory: ./next
run: npm ci
- name: Run Cypress tests against Staging
uses: cypress-io/github-action@v5
with:
working-directory: ./next
browser: chrome
headless: true
config-file: cypress.config.js
config: baseUrl=${{ vars.NEXT_PUBLIC_BASE_URL_FRONTEND }}