Skip to content

Restore and fix financial overview year filter #980

Restore and fix financial overview year filter

Restore and fix financial overview year filter #980

Workflow file for this run

name: Run browser tests
on:
schedule:
- cron: '00 3 * * *'
pull_request:
workflow_dispatch:
inputs:
frontend_branch:
description: 'Frontend branch name'
required: false
default: 'develop'
jobs:
test_ui:
runs-on: ubuntu-latest
defaults:
run:
working-directory: forus-backend
steps:
- name: Checkout forus-backend repo develop branch, if it is scheduled build
if: github.event.schedule == '00 3 * * *'
uses: actions/checkout@v4
with:
path: forus-backend
ref: develop
- name: Checkout forus-backend repo
if: github.event.schedule != '00 3 * * *'
uses: actions/checkout@v4
with:
path: forus-backend
- name: Create .env from .env.docker.dusk
run: cp -n .env.docker.dusk .env && cat .env
- name: Run docker compose up
run: docker compose --profile testing up -d
- name: Set ownership of files due to volume on Github agent
run: docker exec -u 0 forus-backend-app chown -R forus:forus /var/www/
- name: Install dependencies
run: docker compose exec -T app bash -c "composer install"
- name: Create database structure with artisan
run: docker compose exec -T app bash -c "composer dumpautoload && php artisan migrate"
- name: Run base seeders
run: docker compose exec -T app bash -c "php artisan key:generate && php artisan db:seed"
- name: Generate test data
run: docker compose exec -T app php artisan test-data:seed
- name: "Set frontend branch value for manual, auto runs, and PR CI"
run: |
FRONTEND_BRANCH=""
if [[ -n "${{ github.event.inputs.frontend_branch }}" ]]; then
FRONTEND_BRANCH=${{ github.event.inputs.frontend_branch }}
echo "Frontend branch param is set: $FRONTEND_BRANCH"
else
if [[ -n "${{ github.event.pull_request.head.ref }}" ]]; then
FRONTEND_BRANCH="${{ github.event.pull_request.head.ref }}"
echo "Trying to set FRONTEND_BRANCH from PR source branch: $FRONTEND_BRANCH"
if [[ $(git ls-remote --heads https://github.com/teamforus/forus-frontend-react.git "$FRONTEND_BRANCH") ]]; then
echo "Branch $FRONTEND_BRANCH exists in frontend repo, using it"
else
echo "Branch does not exist in 'forus-frontend', defaulting to 'develop'."
FRONTEND_BRANCH="develop"
fi
else
echo "PR source branch is not set, defaulting to 'develop'."
FRONTEND_BRANCH="develop"
fi
fi
echo "FRONTEND_BRANCH=$FRONTEND_BRANCH" >> "$GITHUB_ENV"
- name: Check out forus-frontend-react repo
uses: actions/checkout@v4
with:
repository: teamforus/forus-frontend-react
path: forus-frontend
ref: ${{ env.FRONTEND_BRANCH }}
- name: Create env.js for a frontend
working-directory: forus-frontend
run: cp env.example.js env.js && cat env.js
- name: Frontend docker compose up and build frontends
working-directory: forus-frontend
run: docker compose up -d && docker compose exec app sh -c "npm i && yes n | npm run build" && docker compose down app
- name: Debug - Check connections from backend
run: |
docker compose exec -T app bash -c "wget http://forus-frontend-apache:3000/webshop.general/#/" &&
docker compose exec -T app bash -c "wget http://forus-frontend-apache:3000/dashboard.sponsor/#/" &&
docker compose exec -T app bash -c "wget http://forus-frontend-apache:3000/dashboard.provider/#/"
docker compose exec -T app bash -c "wget http://forus-frontend-apache:3000/dashboard.validator/#/"
- name: Install chrome driver
run: docker compose exec -T app bash -c "php artisan dusk:chrome"
- name: --- RUN BROWSER TESTS ---
run: docker compose exec -T app bash -c "php artisan dusk --testdox"
- uses: actions/upload-artifact@v4
if: always()
with:
name: Upload test results artifacts
path: |
forus-backend/tests/Browser/screenshots/*
forus-backend/tests/Browser/console/*
forus-backend/storage/logs/laravel.log
retention-days: 5