Skip to content

fix: Use correct container definition for rainbow and preview #24870

fix: Use correct container definition for rainbow and preview

fix: Use correct container definition for rainbow and preview #24870

Workflow file for this run

name: E2E Tests
on:
pull_request:
branches: [main, feature/*]
jobs:
cypress-run:
name: Cypress
runs-on: ubuntu-latest
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres@sha256:29e0bb09c8e7e7fc265ea9f4367de9622e55bae6b0b97e7cce740c2d63c2ebc0
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
# Docker Hub image
image: redis@sha256:cc2dfb8f5151da2684b4a09bd04b567f92d07591d91980eb3eca21df07e12760
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
env:
# Needed for Next Auth to initialize
TOKEN_SECRET: testKey
APP_ENV: test
NEXT_PUBLIC_APP_ENV: test
REDIS_URL: localhost
DATABASE_URL: postgres://postgres:postgres@localhost:5432/formsDB
steps:
- name: Checkout
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0
- name: Node.JS Setup
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version-file: .nvmrc
- name: Yarn update to V4
run: corepack enable && yarn set version stable
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
${{ github.workspace }}/.next/cache
key: linux-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
linux-yarn-
- name: "Install dependencies"
run: yarn workspaces focus gcforms
- name: Cypress Tests
uses: cypress-io/github-action@b8ba51a856ba5f4c15cf39007636d4ab04f23e3c # v6.10.2
with:
# we have already installed all dependencies above
install: false
browser: chrome
headed: false
build: yarn build:test
start: yarn start:test
wait-on: "http://localhost:3000"
config: baseUrl=http://localhost:3000
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots