Skip to content

Commit

Permalink
attempt to fix CI not using expected symfony version
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetragramat committed Jan 2, 2024
1 parent 2703a57 commit 57c909c
Showing 1 changed file with 44 additions and 32 deletions.
76 changes: 44 additions & 32 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PHP Composer
name: "CI Tests"

on:
push:
Expand All @@ -9,42 +9,54 @@ on:
permissions:
contents: read

env:
fail-fast: true
PHPUNIT_FLAGS: "-v"
SYMFONY_DEPRECATIONS_HELPER: weak

jobs:
phpunit:
name: PHPUnit
runs-on: ubuntu-latest

name: PHP v${{ matrix.php }} with Symfony v${{ matrix.symfony }}}
strategy:
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
dependencies:
- "highest"
include:
- php-version: "7.4"
dependencies: "lowest"
- { php: "7.4", symfony: "5.4.*", composer-flags: '--prefer-stable' }
- { php: "8.1", symfony: "6.4.*", composer-flags: '--prefer-stable' }
- { php: "8.2", symfony: "7.0.*", composer-flags: '--prefer-stable' }
- { php: "8.3", symfony: "7.*", composer-flags: '--prefer-stable' }

steps:
- uses: actions/checkout@v3

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHPUnit
run: vendor/bin/phpunit --coverage-clover=coverage.xml
- uses: actions/checkout@v2
- name: "Installing php"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl,mbstring,xdebug
ini-values: date.timezone="Europe/Prague"
coverage: xdebug
tools: "composer:v2,flex"

- name: Show PHP version
run: php -v && composer -V

- name: Download Composer cache dependencies from cache
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ matrix.os }}-composer-

- name: Install dependencies
run: |
perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json
composer update ${{ matrix.composer-flags }} --prefer-dist
env:
SYMFONY_REQUIRE: "${{ matrix.symfony }}"

- name: Run PHPUnit
run: vendor/bin/phpunit --coverage-clover=coverage.xml

0 comments on commit 57c909c

Please sign in to comment.