Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
timacdonald committed Feb 17, 2023
1 parent abc6ea8 commit 837e9cb
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,25 @@ jobs:
name: 'Lint'
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- 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-${{ matrix.prefer }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: pcov

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-composer-${{ hashFiles('composer.json') }}-v2

- name: Install dependencies
run: composer install --no-suggest --no-interaction --verbose

Expand All @@ -52,29 +57,34 @@ jobs:

tests:
runs-on: ubuntu-latest
name: 'PHP: ${{ matrix.php }}; PHPUnit: ${{ matrix.phpunit }}; Version: ${{ matrix.dependency-version }}'
name: 'PHP: ${{ matrix.php }}; PHPUnit: ${{ matrix.phpunit }}; Prefer: ${{ matrix.prefer }}'
strategy:
matrix:
php: ['8.1', '8.2']
phpunit: ['^9.0', '^10.0']
dependency-version: ['prefer-lowest', 'prefer-stable']
prefer: ['prefer-lowest', 'prefer-stable']

steps:
- name: checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- 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-${{ matrix.prefer }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-php-${{ matrix.php }}-

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

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-${{ matrix.dependency-version }}-phpunit-${{ matrix.phpunit }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}-v3

- name: Require the dependency matrix version
run: composer require 'phpunit/phpunit:${{ matrix.phpunit }}' --no-update --no-interaction --verbose --no-scripts

Expand All @@ -83,7 +93,7 @@ jobs:
run: cp --force phpunit.9.xml.dist phpunit.xml.dist

- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --no-suggest --no-interaction --verbose --no-scripts
run: composer update --${{ matrix.prefer }} --no-suggest --no-interaction --verbose --no-scripts

- name: Check platform requirements
run: composer check-platform-reqs --verbose
Expand Down

0 comments on commit 837e9cb

Please sign in to comment.