Cypress #2068
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cypress | |
on: | |
push: | |
# schedule: | |
# - cron: "0 5 * * *" | |
workflow_dispatch: | |
env: | |
PROJECT: nig | |
jobs: | |
Cypress: | |
runs-on: ubuntu-latest | |
timeout-minutes: 90 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- uses: rapydo/actions/install@v2 | |
with: | |
project: ${PROJECT} | |
# No need to test cypress in swarm mode! | |
# swarm: 1 | |
- uses: rapydo/actions/setup-cypress@v2 | |
with: | |
id: ${{ secrets.CYPRESS_PROJECT_ID }} | |
key: ${{ secrets.CYPRESS_RECORD_KEY }} | |
- name: Run Cypress | |
run: | | |
rapydo pull --quiet; | |
rapydo build | |
rapydo -e API_AUTOSTART=1 start; | |
# sleep 20 | |
# raised from 20 to 90 after enabling gds | |
sleep 90 | |
rapydo logs | |
rapydo shell backend "bash nig/scripts/init_hpo.sh" | |
rapydo shell frontend "yarn install" | |
rapydo shell frontend "reload-types" | |
rapydo logs | |
rapydo shell frontend "yarn run cypress:start:full" | |
rapydo shell frontend "npx nyc --all report --reporter=lcov --report-dir /coverage" | |
- name: Coverage | |
uses: rapydo/actions/coverage@v2 | |
with: | |
repository: projects/${PROJECT} | |
project: ${PROJECT} | |
step: frontend | |
- name: Docker Logs | |
if: failure() | |
run: | | |
rapydo logs | |
- name: Print backend logs on failure | |
if: failure() | |
run: cat data/logs/backend-server.log |