Skip to content

[Spike] Email Verification - Link #4099

[Spike] Email Verification - Link

[Spike] Email Verification - Link #4099

Workflow file for this run

name: Cypress
on:
push:
branches:
- main
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
merge_group:
branches: [main]
# Concurrency is used to cancel other currently-running jobs, to preserve
# compute resources and cumulative build hours. (ie. If you push twice in a
# row, this will cancel the previous run.)
# See: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
concurrency:
# This scopes the group to:
# - the same workflow,
# - the same event type, and
# - the same branch name
# e.g., my-workflow-pull_request-feature/123-my-thing
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
cypress:
name: Cypress
# Platform recommended in cypress-io/github-action docs.
runs-on: ubuntu-22.04
env:
# Use native docker command within docker-compose
COMPOSE_DOCKER_CLI_BUILD: 1
# Use buildkit to speed up docker command
DOCKER_BUILDKIT: 1
PNPM_VERSION: "8.15.0"
steps:
# See: https://github.com/satackey/action-docker-layer-caching/issues/139#issuecomment-1007316528
- name: reclaim space on runner
run: rm -rf /usr/local/android /usr/share/dotnet /usr/local/share/boost /opt/ghc
- name: Checkout
uses: actions/checkout@v4
# We no longer user docker layer caching as it made runs take longer.
# See: https://github.com/satackey/action-docker-layer-caching/issues/305
- name: Serve app via docker-compose
# Need to include --build as we're caching layers.
run: docker-compose up --detach --build
- name: "Run: setup.sh"
run: docker-compose run --rm maintenance bash setup.sh -c
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: pnpm
- name: Set up Cypress binary cache
uses: actions/cache@v4
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-cypress-${{ hashFiles('pnpm-lock.yaml') }}
- name: "Install dependencies: workspace"
working-directory: ./
run: pnpm install
- name: "Run Cypress tests: all"
uses: cypress-io/[email protected]
with:
install: true
spec: "**/*.cy.ts"
browser: electron
config-file: cypress.config.ts
project: ./apps/e2e
# See: https://github.com/cypress-io/github-action/issues/489#issuecomment-1021379037
command-prefix: "--"
config: video=false
# NOTE: screenshots will be generated only if E2E test failed
# thus we store screenshots only on failures
- name: Save screenshot artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: apps/e2e/cypress/screenshots
- name: Check status of containers
if: failure()
run: docker-compose ps
- name: "Check logs: web server container"
if: failure()
run: docker-compose logs webserver