Skip to content

Bump intervention/image from 2.7.2 to 3.9.1 #1184

Bump intervention/image from 2.7.2 to 3.9.1

Bump intervention/image from 2.7.2 to 3.9.1 #1184

name: Run unit and feature tests
on:
pull_request:
workflow_dispatch:
inputs:
debug:
description: 'Enable debug mode'
required: false
default: 'true'
jobs:
test_features:
runs-on: ubuntu-latest
defaults:
run:
working-directory: forus-backend
steps:
- name: Checkout forus-backend repo
uses: actions/checkout@v4
with:
path: forus-backend
- name: Copy .env.docker.dusk file to .env
run: cp -n .env.docker.dusk .env
- name: Run docker compose up
run: docker compose up -d
- name: Set correct ownership of files in docker
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 && composer dumpautoload"
- name: Run migrations to create DB structure
run: docker compose exec -T app bash -c "php artisan migrate"
- name: Test rollback
run: |
docker compose exec -T app bash -c "
for i in {1..10}
do
php artisan migrate:rollback --step=\$i;
php artisan migrate;
done"
- name: Run seeders
run: |
docker compose exec -T app bash -c "php artisan key:generate && php artisan db:seed && php artisan test-data:seed"
- name: Set debug based on input
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ "${{ inputs.debug }}" == "true" ]; then
echo "DEBUG=--debug" >> $GITHUB_ENV
else
echo "DEBUG=" >> $GITHUB_ENV
fi
- name: --- RUN UNIT TESTS ---
run: docker compose exec -T app bash -c "./vendor/bin/phpunit $DEBUG_FLAG tests/Unit/."
- name: --- RUN FEATURE TESTS ---
working-directory: forus-backend
run: docker compose exec -T app bash -c "./vendor/bin/phpunit $DEBUG_FLAG tests/Feature/."