Tests #234
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.x, 1.x] | |
pull_request: | |
branches: [2.x, 1.x] | |
schedule: | |
- cron: '3 2 1 * *' | |
workflow_dispatch: {} | |
env: | |
SYMFONY_DEPRECATIONS_HELPER: "max[direct]=0" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ matrix.experimental }} | |
name: '${{ matrix.deps }} deps: PHP=${{ matrix.php }}, Symfony=${{ matrix.symfony }}, Laravel=${{ matrix.laravel }}' | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- deps: 'low' | |
php: '8.0' | |
experimental: false | |
composer: v2 | |
- deps: 'stable' | |
php: '8.3' | |
symfony: '6.x' | |
laravel: '10.x' | |
experimental: false | |
composer: v2 | |
- deps: 'stable' | |
php: '8.3' | |
symfony: '7.x' | |
laravel: '11.x' | |
experimental: false | |
composer: v2 | |
- deps: 'dev' | |
php: '8.4' | |
symfony: '7.x' | |
laravel: '12.x' | |
experimental: true | |
composer: preview | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: xml, pdo_sqlite | |
tools: "composer:${{ matrix.composer }}" | |
- name: Set-up env variables | |
id: ctx | |
run: | | |
echo "::set-output name=composer_dir::$(composer config cache-files-dir)" | |
case "${{ matrix.deps }}" in | |
"low") | |
echo "COMPOSER_FLAGS=--prefer-lowest" >> $GITHUB_ENV | |
echo "SYMFONY_DEPRECATIONS_HELPER=disabled=1" >> $GITHUB_ENV | |
;; | |
"dev") | |
echo "COMPOSER_FLAGS=--ignore-platform-req=php+" >> $GITHUB_ENV | |
composer config minimum-stability dev | |
;; | |
esac | |
if [ -n "${{ matrix.symfony }}" ]; then | |
echo "SYMFONY_REQUIRE=$(echo '${{ matrix.symfony }}' | tr x \\*)" >> $GITHUB_ENV | |
fi | |
if [ -n "${{ matrix.laravel }}" ]; then | |
echo "LARAVEL_REQUIRE=$(echo '${{ matrix.laravel }}' | tr x \\*)" >> $GITHUB_ENV | |
fi | |
echo "PHP_VERSION=${{ matrix.php }}" >> $GITHUB_ENV | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.ctx.outputs.composer_dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }} | |
- name: Install dependencies | |
run: | | |
composer global config --no-plugins allow-plugins.symfony/flex true | |
composer global require --no-progress --no-scripts --no-plugins symfony/flex | |
if [ "$LARAVEL_REQUIRE" != "" ]; then | |
composer require --no-update illuminate/database:$LARAVEL_REQUIRE illuminate/events:$LARAVEL_REQUIRE illuminate/console:$LARAVEL_REQUIRE | |
fi | |
composer update --prefer-dist --no-progress $COMPOSER_FLAGS | |
./vendor/bin/simple-phpunit install | |
- name: Show info | |
run: | | |
echo "$(php --version)" | |
echo "" | |
echo "$(php tests/Functional/app/bin/console --version)" | |
- name: Run test suite | |
run: ./vendor/bin/simple-phpunit | |
- name: Run static analysis | |
if: '!matrix.experimental' | |
run: ./vendor/bin/psalm --php-version=$PHP_VERSION |