Skip to content

Commit

Permalink
update the GitHub actions configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Oct 31, 2023
1 parent 8f81e74 commit f54edef
Showing 1 changed file with 30 additions and 31 deletions.
61 changes: 30 additions & 31 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ jobs:

steps:
- name: 'Check out'
uses: 'actions/checkout@v2'
uses: 'actions/checkout@v4'

- name: 'Set up PHP'
uses: 'shivammathur/setup-php@v2'
- uses: actions/cache@v3
with:
php-version: '${{ matrix.php-version }}'
coverage: 'none'
path: '.php-cs-fixer.cache'
key: '${{ runner.OS }}-${{ github.repository }}-phpcsfixer-${{ github.sha }}'
restore-keys: |
${{ runner.OS }}-${{ github.repository }}-phpcsfixer-
- name: 'Check the code style'
uses: docker://oskarstark/php-cs-fixer-ga
uses: 'docker://oskarstark/php-cs-fixer-ga'
with:
args: '--diff --dry-run'

Expand All @@ -35,29 +36,24 @@ jobs:

runs-on: 'ubuntu-latest'

strategy:
matrix:
php-version:
- '8.1'

steps:
- name: 'Check out'
uses: 'actions/checkout@v2'
uses: 'actions/checkout@v4'

- name: 'Set up PHP'
uses: 'shivammathur/setup-php@v2'
- name: 'Cache dependencies'
uses: 'actions/cache@v3'
with:
php-version: '${{ matrix.php-version }}'
coverage: 'none'
path: '/tmp/composer-cache'
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"

- name: 'Install dependencies'
uses: php-actions/composer@v6
uses: 'php-actions/composer@v6'

- name: 'Run PhpStan'
uses: 'php-actions/phpstan@v3'
with:
configuration: 'phpstan.neon'
level: max
level: 'max'

tests:
name: 'PHPUnit'
Expand Down Expand Up @@ -88,33 +84,36 @@ jobs:

steps:
- name: 'Check out'
uses: 'actions/checkout@v2'
uses: 'actions/checkout@v4'

- name: 'Set up PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php-version }}'
coverage: 'none'

- name: 'Get Composer cache directory'
id: 'composer-cache'
run: 'echo "::set-output name=cache-dir::$(composer config cache-files-dir)"'

- name: 'Cache dependencies'
uses: 'actions/cache@v2'
uses: 'actions/cache@v3'
with:
path: '${{ steps.composer-cache.outputs.cache-dir }}'
path: '/tmp/composer-cache'
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: 'php-${{ matrix.php-version }}-composer-locked-'

- name: 'Allow Symfony Flex as a global plugin'
uses: 'php-actions/composer@v6'
with:
command: 'global config --no-plugins allow-plugins.symfony/flex true'

- name: 'Install Symfony Flex globally'
uses: 'php-actions/composer@v6'
with:
command: 'global require --no-progress --no-scripts --no-plugins symfony/flex'

- name: 'Install dependencies'
uses: 'php-actions/composer@v6'
env:
COMPOSER_OPTIONS: '${{ matrix.composer-options }}'
SYMFONY_REQUIRE: '${{ matrix.symfony-version }}'
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins symfony/flex
composer update --no-progress $COMPOSER_OPTIONS
with:
command: 'update --no-progress ${{ matrix.composer-options }}'

- name: 'Install PHPUnit'
run: 'vendor/bin/simple-phpunit install'
Expand Down

0 comments on commit f54edef

Please sign in to comment.