PHP Composer #27
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: PHP Composer | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
schedule: | |
- cron: '3 14 * * *' | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
php: [8.1, 8.2, 8.3] | |
stability: [prefer-lowest, prefer-stable] | |
name: PHP ${{ matrix.php }} ${{ matrix.stability }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 # v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: curl | |
ini-values: error_reporting=E_ALL | |
tools: composer:v2 | |
coverage: none | |
- name: Validate composer.json and composer.lock | |
run: composer validate --strict | |
- name: Get Composer cache directory | |
id: composer-cache | |
run: | | |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache Composer | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.stability }}-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.stability }}- | |
- name: Install dependencies | |
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3 | |
with: | |
timeout_minutes: 5 | |
max_attempts: 5 | |
command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress | |
- name: Run tests | |
run: vendor/bin/phpunit --display-deprecation |