Skip to content

Better cypress conf for github actions #1268

Better cypress conf for github actions

Better cypress conf for github actions #1268

name: Cypress tests
on:
push:
paths:
- 'daikoku/app/**'
- 'daikoku/javascript/**'
- '.github/workflows/front-office-tests.yml'
workflow_dispatch:
jobs:
cypress-run:
name: Cypress run
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_DB: daikoku_test
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
# install node lts
- name: setup node
uses: actions/setup-node@v3
with:
node-version: latest
cache: 'npm'
cache-dependency-path: daikoku/javascript/package-lock.json
- uses: coursier/cache-action@v5
- name: initialize backend build
run: |
cd daikoku
sbt ';clean;compile'
- name: Installing dependencies
run: |
cd daikoku/javascript
rm -rf node_modules/
npm install
- name: build javascript
run: |
cd daikoku/javascript
npm run build
env:
NODE_OPTIONS: --max_old_space_size=4096
- name: Cypress run and publish report
uses: cypress-io/github-action@v6
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
with:
browser: chrome
start: npm run cypress:start:backend
wait-on: 'http://localhost:9000'
command: npm run test:cypress
working-directory: daikoku/javascript