Merge pull request #983 from portabilis/dependabot/composer/league/co… #435
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: Tests | |
on: | |
push: | |
branches: | |
- 2.* | |
- main | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
default: | |
name: Unit, Integration and Pages | |
if: '! github.event.pull_request.draft' | |
runs-on: ubuntu-latest | |
env: | |
APP_URL: http://localhost:8000 | |
APP_ENV: testing | |
DB_CONNECTION: pgsql | |
DB_HOST: localhost | |
DB_PORT: 5432 | |
DB_DATABASE: ieducar | |
DB_USERNAME: postgres | |
DB_PASSWORD: postgres | |
API_ACCESS_KEY: ieducar-access-key | |
API_SECRET_KEY: ieducar-secret-key | |
BROADCAST_DRIVER: log | |
CACHE_DRIVER: array | |
QUEUE_CONNECTION: sync | |
SESSION_DRIVER: array | |
LEGACY_SEED_DATA: false | |
COMPOSER_ALLOW_SUPERUSER: 1 | |
NODE_OPTIONS: --max_old_space_size=1024 | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: ieducar | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3 | |
steps: | |
- name: Setup PHP | |
uses: actions/checkout@v4 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.2' | |
extensions: bcmath, gd, pdo, pcntl, pdo_pgsql, pgsql, zip | |
env: | |
update: true | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install Dependencies | |
run: composer new-install | |
- name: Prepare tests | |
run: php artisan legacy:create:tests | |
- name: Unit tests | |
run: vendor/bin/pest |