wip #1
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: "CI Tests" | ||
on: | ||
push: | ||
pull_request: | ||
jobs: | ||
tests: | ||
name: "PHP ${{ matrix.php }} ${{ matrix.composer-flags != '' && format(' - Composer {0}', matrix.composer-flags) || '' }}" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: | ||
- '7.4' | ||
- '8.0' | ||
- '8.1' | ||
- '8.2' | ||
- '8.3' | ||
composer-flags: | ||
- '--prefer-stable' | ||
include: | ||
# Lowest Deps | ||
- php: 7.4 | ||
composer-flags: '--prefer-stable --prefer-lowest' | ||
services: | ||
db: | ||
# Docker Hub image | ||
image: mariadb:10.11.8 | ||
ports: | ||
- 3306:3306 | ||
environment: | ||
MARIADB_USER: test | ||
MARIADB_PASSWORD: foobar | ||
MARIADB_DATABASE: bookstore | ||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v3" | ||
with: | ||
fetch-depth: 2 | ||
- name: "Cache Composer packages" | ||
uses: "actions/cache@v3" | ||
with: | ||
path: "~/.composer/cache" | ||
key: "php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}-flags-${{ matrix.composer-flags }}" | ||
restore-keys: "php-" | ||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "${{ matrix.php }}" | ||
tools: "composer:v2,flex" | ||
- name: "Set Composer stability" | ||
run: "composer config minimum-stability dev" | ||
- name: "Install dependencies" | ||
run: "composer update ${{ matrix.composer-flags }} --prefer-dist" | ||
- name: "Validate composer" | ||
run: "composer validate --strict --no-check-lock --no-check-all" | ||
- name: "Build database" | ||
run: | | ||
cp Tests/Fixtures/App/app/config/parameters.yml.dist Tests/Fixtures/App/app/config/parameters.yml | ||
composer install --dev | ||
./Tests/Fixtures/App/app/console propel:database:create | ||
./Tests/Fixtures/App/app/console propel:sql:insert --force | ||
./Tests/Fixtures/App/app/console propel:build | ||
- name: "Run PHPUnit Tests" | ||
run: "vendor/bin/phpunit" | ||