Skip to content

chore(release): 3.1.0-rc.38 #4072

chore(release): 3.1.0-rc.38

chore(release): 3.1.0-rc.38 #4072

name: Klicker automated testing with cypress
on:
push:
branches: ['v3', 'v3*']
pull_request:
branches: ['v3', 'v3*']
types: [opened, synchronize, reopened]
# workflow_dispatch:
env:
REGISTRY: ghcr.io
jobs:
cypress-run:
# runs-on: self-hosted
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: klicker
POSTGRES_PASSWORD: klicker
POSTGRES_DB: klicker-prod
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis_cache:
image: redis:7
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6380:6379
redis_exec:
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
image: redis:7
ports:
- 6379:6379
# strategy:
# fail-fast: false # https://github.com/cypress-io/github-action/issues/48
# matrix:
# containers: [1, 2] # Run parallel instances
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- name: Define node version
uses: actions/setup-node@v3
with:
node-version: 20
- name: Check out repository code
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.14.1
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: |
${{ env.STORE_PATH }}
~/.cache/Cypress
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- uses: actions/cache@v3
name: Setup turbo cache
with:
path: |
.turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Install bun
run: pnpm add -g bun@1.0.7
- name: Install dependencies
run: pnpm install
# - name: Install azure-functions-core-tools
# run: npm i -g azure-functions-core-tools@4 --unsafe-perm true
- name: Prepare .env and local.settings.json files
run: |
mv apps/backend-docker/.env.cypress apps/backend-docker/.env
echo "$FUNC_RESPONSES_SETTINGS" > apps/func-incoming-responses/local.settings.json
echo "$FUNC_RESPONSE_PROCESSOR_SETTINGS" > apps/func-response-processor/local.settings.json
env:
FUNC_RESPONSES_SETTINGS: ${{ secrets.FUNC_RESPONSES_SETTINGS }}
FUNC_RESPONSE_PROCESSOR_SETTINGS: ${{ secrets.FUNC_RESPONSE_PROCESSOR_SETTINGS }}
- name: Build all packages and apps
run: pnpm run --filter @klicker-uzh/prisma build:test && pnpm run build:test
- name: Apply migrations and seed the database
run: |
cd packages/prisma
pnpm run prisma:reset:raw -f
pnpm run seed:test
env:
DATABASE_URL: postgres://klicker:klicker@localhost:5432/klicker-prod
- name: Start services in the background
run: pnpm run start:test &
env:
DATABASE_URL: postgres://klicker:klicker@localhost:5432/klicker-prod
# run: pnpm run start:test
- name: Cypress run
uses: cypress-io/github-action@v6
timeout-minutes: 20
with:
install: false
wait-on: 'http://127.0.0.1:3000/api/graphql, http://127.0.0.1:3001, http://127.0.0.1:3002, http://127.0.0.1:3003, http://127.0.0.1:3010'
wait-on-timeout: 300
record: true
browser: electron
working-directory: cypress
# parallel: true
env:
APP_SECRET: abcd
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
DATABASE_URL: postgres://klicker:klicker@localhost:5432/klicker-prod
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_ENV: production
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage
path: cypress/coverage
- name: Coveralls
uses: coverallsapp/github-action@v2