Skip to content

Working torwards scricter types. #178

Working torwards scricter types.

Working torwards scricter types. #178

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@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 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@9e72090525849c5e82e596468b86eb55e9cc5401 # 2.32.0
with:
php-version: 8.3
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install dependencies
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # 3.1.0
- 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@9e72090525849c5e82e596468b86eb55e9cc5401 # 2.32.0
with:
php-version: latest
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install dependencies
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # 3.1.0
- 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.4 - PHPStan
runs-on: ubuntu-latest
needs:
- php_syntax_errors
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup PHP
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # 2.32.0
with:
php-version: 8.4
coverage: none
tools: phpstan
- name: Install Composer dependencies
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # 3.1.0
- 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.3
- 8.4
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup PHP Action
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # 2.32.0
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.extensions }}
coverage: xdebug
tools: pecl, composer
- name: Install Composer dependencies
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # 3.1.0
- name: Run tests
run: composer run-tests