run-checks #711
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: run-checks | |
on: | |
workflow_run: | |
workflows: [ "fix-styling" ] | |
types: | |
- completed | |
jobs: | |
static-analysis: | |
name: static-analysis | |
runs-on: ${{ matrix.os }} | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ ubuntu-latest ] | |
php: ["8.1"] | |
laravel: ["^10.0"] | |
dependency-version: [ prefer-stable ] | |
include: | |
- laravel: "^10.0" | |
testbench: "^8.1" | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo | |
coverage: none | |
- name: Setup Problem Matches | |
run: | | |
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- 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 | |
- name: Psalm | |
run: ./vendor/bin/psalm --output-format=github | |
- name: PHPStan | |
run: ./vendor/bin/phpstan | |
- name: PHP MessDetector | |
run: ./vendor/bin/phpmd src github phpmd-ruleset.xml.dist | |
- name: PHP Code Sniffer | |
run: ./vendor/bin/phpcs | |
tests: | |
needs: [ 'static-analysis' ] | |
runs-on: 'ubuntu-latest' | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [ ubuntu-latest ] | |
php: ["8.1"] | |
laravel: ["^10.0"] | |
dependency-version: [ prefer-stable ] | |
include: | |
- laravel: "^10.0" | |
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo | |
tools: composer:v2 | |
coverage: true | |
- name: Setup Problem Matches | |
run: | | |
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Install Composer dependencies | |
run: | | |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update --dev | |
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction | |
- name: Execute Tests (Ubuntu) + Coverage | |
if: matrix.os == 'ubuntu-latest' | |
run: vendor/bin/pest --parallel --coverage-clover="build/clover.xml" | |
env: | |
RUNNING_IN_CI: true | |
- name: Upload Coverage | |
if: github.ref == 'refs/heads/main' && matrix.php == '8.1' && matrix.laravel == '10.*' && matrix.os == 'ubuntu-latest' && matrix.dependency-version == 'prefer-stable' | |
uses: codacy/[email protected] | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: build/clover.xml | |
- name: Upload coverage to Codecov | |
if: github.ref == 'refs/heads/main' && matrix.php == '8.1' && matrix.laravel == '10.*' && matrix.os == 'ubuntu-latest' && matrix.dependency-version == 'prefer-stable' | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: ./build/ |