Merge pull request #46 from openfoodfacts/dependabot/github_actions/a… #135
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: CI | |
on: | |
push: | |
pull_request: | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [8.0, 8.1] | |
laravel: [9.*] | |
dependency-version: [prefer-lowest, prefer-stable] | |
include: | |
- laravel: 9.* | |
testbench: 7.* | |
name: Tests - PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-version }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 10 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, xdebug | |
coverage: xdebug | |
- name: Report PHP version | |
run: php -v | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache dependencies | |
uses: actions/[email protected] | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ matrix.php }}-composer- | |
- name: Install Composer dependencies | |
run: | | |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update | |
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest | |
- name: Execute tests | |
run: vendor/bin/phpunit --verbose --coverage-clover ./build/coverage.clover | |
- name: Uploading code coverage to scrutinize | |
uses: sudo-bot/action-scrutinizer@latest | |
with: | |
cli-args: "--format=php-clover build/coverage.clover" |