Files
basango/.github/workflows/backend/tests.yaml
T
2025-10-05 14:42:25 +02:00

68 lines
1.9 KiB
YAML

name: tests
on:
workflow_call:
push:
branches-ignore:
- main
paths:
- "projects/backend/**"
- ".github/workflows/backend/**"
pull_request:
branches-ignore:
- main
paths:
- "projects/backend/**"
- ".github/workflows/backend/**"
jobs:
functional:
name: Functional Tests
runs-on: ubuntu-latest
# services:
# mysql:
# image: mariadb:10.11.11
# env:
# MYSQL_ALLOW_EMPTY_PASSWORD: false
# MYSQL_ROOT_PASSWORD: root
# MYSQL_DATABASE: root
# ports:
# - 3306/tcp
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: [8.4]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
- name: Setup cache
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
- name: Cache dependencies installed with composer
uses: actions/cache@v4
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-latest-
- name: Update composer
run: composer self-update
- name: Install dependencies with composer
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
# - name: Setup mysql
# run: sudo systemctl start mysql
- name: Run functional tests
run: composer app:test
env:
APP_ENV: test
# DATABASE_URL: mysql://root:root@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/app_test