Skip to content

feat: cache composer dependencies #119

feat: cache composer dependencies

feat: cache composer dependencies #119

Workflow file for this run

name: Continuous Integration
on: [push, pull_request]
jobs:
linter:
name: Code style
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
- run: composer install --prefer-dist --no-interaction
- run: bin/php-cs-fixer fix --ansi --dry-run --using-cache=no --verbose
atoum-tests:
name: Atoum tests
runs-on: ubuntu-20.04
strategy:
matrix:
version: [ 8.1, 8.2 ]
flags: [ '', '--prefer-lowest' ]
fail-fast: false
steps:
- uses: actions/checkout@master
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.version }}
coverage: xdebug2
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- run: composer update --prefer-dist --no-interaction ${{ matrix.flags }}
- run: bin/atoum
phpstan:
name: PHPStan checks
runs-on: ubuntu-20.04
strategy:
matrix:
version: [ 8.1, 8.2 ]
flags: [ '', '--prefer-lowest' ]
fail-fast: false
steps:
- uses: actions/checkout@master
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.version }}
coverage: xdebug2
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- run: composer update --prefer-dist --no-interaction ${{ matrix.flags }}
- run: bin/phpstan