Skip to content

Commit

Permalink
ci: switch to ramsey/composer-install (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas authored Jan 21, 2022
1 parent ac9b31b commit 0d9551c
Showing 1 changed file with 13 additions and 24 deletions.
37 changes: 13 additions & 24 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
dependencies:
- highest
include:
- php-version: "7.1"
- php-version: "7.2"
- php-version: "7.3"
- php-version: "7.4"
- php-version: "8.0"
- php-version: "8.1"
- php-version: "8.1"
prefer: lowest
dependencies: lowest

steps:
- name: Start MySQL
Expand All @@ -41,24 +44,10 @@ jobs:
php-version: ${{ matrix.php-version }}
extensions: mbstring, xml, ctype, iconv, intl, pdo_mysql, pdo_pgsql

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

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

- name: Install dependencies
if: ${{ matrix.prefer != 'lowest' }}
run: composer update --prefer-dist --no-interaction --no-progress

- name: Install lowest dependencies
if: ${{ matrix.prefer == 'lowest' }}
run: composer update --prefer-lowest --prefer-dist --no-interaction --no-progress
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"

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

0 comments on commit 0d9551c

Please sign in to comment.