Skip to content

Bump graphql from 16.6.0 to 16.8.1 #974

Bump graphql from 16.6.0 to 16.8.1

Bump graphql from 16.6.0 to 16.8.1 #974

name: E2E Cypress Tests (Firefox)
on:
push:
branches:
- main
pull_request:
pull_request_target:
types:
- labeled
jobs:
label_check:
runs-on: ubuntu-latest
outputs:
authorized: ${{ steps.label_check.outputs.authorized }}
steps:
- name: Check if authorized label is present
id: label_check
run: |
LABEL_NAME="CI Approved"
PR_LABELS=$(jq '.pull_request.labels[].name' $GITHUB_EVENT_PATH | tr '\n' ' ')
if [[ ${PR_LABELS} =~ ${LABEL_NAME} ]]; then
echo "Authorized label found."
echo "::set-output name=authorized::true"
else
echo "Authorized label not found."
echo "::set-output name=authorized::false"
fi
cypress-e2e-firefox:
name: Cypress E2E Firefox
runs-on: ubuntu-20.04
# Don't run the e2e tests for dependabot prs or if the PR is not labeled as 'safe to test'.
if: |
${{ github.event.pull_request.user.login == 'dependabot[bot]' &&
needs.label_check.outputs.authorized == 'true' }}
# Only run the e2e tests if a maintainer has labeled the PR as 'safe to test'.
needs: [label_check]
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: 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: firefox
headless: true
spec: cypress/e2e/**/*.ts
record: true
parallel: true
group: 2. Firefox