Skip to content

phpstan bump + composer bump #145

phpstan bump + composer bump

phpstan bump + composer bump #145

Workflow file for this run

name: Tests
# Run this workflow every time a new commit pushed to your repository
on:
push:
paths-ignore:
- '**/*.md'
- '**/*.markdown'
pull_request:
paths-ignore:
- '**/*.md'
- '**/*.markdown'
jobs:
kill_previous:
name: 0️⃣ Kill previous runs
runs-on: ubuntu-latest
# We want to run on external PRs, but not on our own internal PRs as they'll be run by the push to the branch.
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
php_syntax_errors:
name: 1️⃣ PHP - Syntax errors
runs-on: ubuntu-latest
needs:
- kill_previous
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
uses: ramsey/composer-install@v3
- name: Check source code for syntax errors
run: vendor/bin/parallel-lint --exclude .git --exclude vendor .
code_style_errors:
name: 2️⃣ PHP - Code Style errors
runs-on: ubuntu-latest
needs:
- php_syntax_errors
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: latest
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
uses: ramsey/composer-install@v3
- name: Check source code for code style errors
run: PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --verbose --diff --dry-run
# phpstan:
# name: 2️⃣ PHP 8.1 - PHPStan
# runs-on: ubuntu-latest
# needs:
# - php_syntax_errors
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Setup PHP
# uses: shivammathur/setup-php@v2
# with:
# php-version: 8.1
# coverage: none
# tools: phpstan
# - name: Install Composer dependencies
# uses: ramsey/composer-install@v3
# - name: Run PHPStan
# run: vendor/bin/phpstan analyze
tests:
name: 2️⃣ PHP ${{ matrix.php-version }}
needs:
- php_syntax_errors
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version:
- 8.2
- 8.3
env:
COMPOSER_NO_INTERACTION: 1
extensions: curl, json, libxml, dom
key: cache-v1 # can be any string, change to clear the extension cache.
steps:
# Checks out a copy of your repository on the ubuntu machine
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.extensions }}
coverage: xdebug
tools: pecl, composer
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- name: Run tests
run: composer run-tests