Skip to content

Remove pr_target privileged run label check for Cypress Actions #976

Remove pr_target privileged run label check for Cypress Actions

Remove pr_target privileged run label check for Cypress Actions #976

name: E2E Cypress Tests (Chrome)
on:
push:
branches:
- main
pull_request:
jobs:
cypress-e2e-chrome:
name: Cypress E2E Chrome
runs-on: ubuntu-latest
# Don't run the e2e tests for dependabot prs.
if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' }}
timeout-minutes: 15
strategy:
# when one test fails, DO NOT cancel the other
# containers, because this will kill Cypress processes
# leaving the Dashboard hanging ...
# https://github.com/cypress-io/github-action/issues/48
fail-fast: false
matrix:
# run 4 copies of the current job in parallel
containers: [1, 2, 3, 4, 5]
steps:
- name: Checkout
uses: actions/checkout@v4
# enables use to use the cache in actions/setup-node
- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: CacheAreas
id: cache-areas
uses: actions/cache@v3
with:
path: ./src/api/db/manage/areaToDatabase/.areaInfo.geojson
key: ${{ runner.os }}-areaInfo
- name: Install dependencies
run: pnpm install
- name: Database init
uses: supabase/setup-cli@v1
with:
version: 1.27.7
- run: SUPABASE_SCANNER_BUFFER_SIZE=5mb supabase start
- name: NextCache
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Cypress run
uses: cypress-io/github-action@v4
env:
DATABASE_NAME: toiletmap
VERCEL_URL: http://localhost:3000
AUTH0_SECRET: ${{ secrets.AUTH0_SECRET }}
AUTH0_ISSUER_BASE_URL: https://gbptm.eu.auth0.com/
AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID }}
AUTH0_CLIENT_SECRET: ${{ secrets.AUTH0_CLIENT_SECRET }}
AUTH0_AUDIENCE: https://www.toiletmap.org.uk/graphql
AUTH0_PERMISSIONS_KEY: https://toiletmap.org.uk/permissions
AUTH0_PROFILE_KEY: https://toiletmap.org.uk/profile
CYPRESS_auth0SessionCookieName: 'appSession'
CYPRESS_auth0Username: ${{ secrets.CYPRESS_AUTH0USERNAME }}
CYPRESS_auth0Password: ${{ secrets.CYPRESS_AUTH0PASSWORD }}
CYPRESS_auth0Scope: 'openid profile email'
CYPRESS_auth0Domain: 'gbptm.eu.auth0.com'
CYPRESS_auth0Audience: https://www.toiletmap.org.uk/graphql
CYPRESS_auth0ClientSecret: ${{ secrets.CYPRESS_AUTH0CLIENTSECRET }}
CYPRESS_auth0ClientId: ${{ secrets.CYPRESS_AUTH0CLIENTID }}
CYPRESS_auth0CookieSecret: ${{ secrets.CYPRESS_AUTH0COOKIESECRET }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
with:
build: pnpm build
start: pnpm start
wait-on: 'http://localhost:3000/'
wait-on-timeout: 60
browser: chrome
spec: cypress/e2e/**/*.ts
record: true
headless: new
parallel: true
group: 1. Chrome