Cypress tests on PR pipeline #2
Workflow file for this run
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 tests on pr | |
on: | |
pull_request: | |
branches: [ master ] | |
types: [opened, synchronize, reopened] | |
paths: | |
- 'frontend/**' | |
- '!frontend/stats/**' | |
- 'backend/**' | |
- '.github/workflows/run-cypress-on-pr.yaml' | |
workflow_dispatch: | |
jobs: | |
cypress-tests: | |
name: Build environment and run e2e test | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Generate .env file | |
run: | | |
echo CYPRESS_TEST_APP=autodeploy-v3 >> .env | |
echo DEVELOP_APP_DEVELOPMENT=0 >> .env | |
echo DEVELOP_RESOURCE_ADMIN=0 >> .env | |
echo DEVELOP_BACKEND=0 >> .env | |
echo DEVELOP_DASHBOARD=0 >> .env | |
echo DEVELOP_PREVIEW=0 >> .env | |
echo GITEA_ADMIN_PASS=g9wDIG@6gf >> .env | |
echo GITEA_ADMIN_USER=localg1iteaadmin >> .env | |
echo GITEA_CYPRESS_USER=cypress_testuser >> .env | |
echo GITEA_CYPRESS_PASS=g9wDIG@6gf >> .env | |
echo GITEA_ORG_USER=ttd >> .env | |
echo POSTGRES_PASSWORD=kyeDIG@eip >> .env | |
echo COMMIT= >> .env | |
- name: Build all images | |
run: | | |
docker compose build --no-cache | |
- name: Install node | |
uses: actions/setup-node@v4 | |
with: | |
cache: 'yarn' | |
- name: Run setup.js script | |
run: | | |
node ./development/setup.js | |
- name: Wait 30 seconds | |
run: | | |
sleep 30s | |
- name: Run cypress tests | |
run: | | |
docker ps | |
echo here should be the cypress tests command | |
- name: Stop compose file | |
if: always() | |
run: docker-compose down | |
# Might should do prune as well |