Try cache v3 for GH actions instead. #69
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: Build | |
on: [push, pull_request] | |
jobs: | |
run: | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
operating-system: [ubuntu-latest, windows-latest] | |
php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] | |
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: openssl,mbstring,gmp | |
coverage: xdebug | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Install Composer dependencies | |
if: ${{ matrix.php-versions != '8.1' }} | |
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader | |
- name: Install Composer dependencies (8.1) | |
if: ${{ matrix.php-versions == '8.1' }} | |
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader --ignore-platform-reqs | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Run Specs | |
run: composer run-script test |