Merge pull request #70 from KentarouTakeda/php-version #37
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: | |
pull_request: | |
push: | |
branches: | |
- "master" | |
jobs: | |
tests: | |
name: "Tests" | |
runs-on: "ubuntu-20.04" | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: | |
- "8.1" | |
- "8.2" | |
- "8.3" | |
- "8.4" | |
dependencies: | |
- "lowest" | |
- "highest" | |
exclude: | |
- php-version: "8.4" | |
dependencies: "lowest" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
with: | |
fetch-depth: 2 | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
php-version: "${{ matrix.php-version }}" | |
coverage: "pcov" | |
ini-values: "zend.assertions=1" | |
- name: "Install dependencies with Composer" | |
uses: "ramsey/composer-install@v3" | |
with: | |
dependency-versions: "${{ matrix.dependencies }}" | |
- name: "Run PHPUnit" | |
run: "vendor/bin/phpunit --coverage-clover=coverage.xml" | |
- name: "Upload coverage file" | |
uses: "actions/upload-artifact@v4" | |
with: | |
name: "phpunit-${{ matrix.dependencies }}-${{ matrix.php-version }}.coverage" | |
path: "coverage.xml" | |
upload_coverage: | |
name: "Upload coverage to Codecov" | |
runs-on: "ubuntu-20.04" | |
needs: | |
- "tests" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
with: | |
fetch-depth: 2 | |
- name: "Download coverage files" | |
uses: "actions/download-artifact@v4" | |
with: | |
path: "reports" | |
- name: "Upload to Codecov" | |
uses: "codecov/codecov-action@v3" | |
with: | |
directory: reports | |
coding-standards: | |
name: "Coding Standards" | |
runs-on: "ubuntu-20.04" | |
strategy: | |
matrix: | |
php-version: | |
- "8.2" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
php-version: "${{ matrix.php-version }}" | |
tools: "cs2pr" | |
- name: "Install dependencies with Composer" | |
uses: "ramsey/composer-install@v3" | |
- name: "Install php-cs-fixer" | |
run: composer require "friendsofphp/php-cs-fixer:^3.23" | |
- name: "Run php-cs-fixer" | |
run: "vendor/bin/php-cs-fixer fix --diff --dry-run -v" |