Skip to content

test: harden test suite and improve reliability #7

test: harden test suite and improve reliability

test: harden test suite and improve reliability #7

Workflow file for this run

name: crypto CI
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
jobs:
quality:
name: Quality Checks (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ "8.2", "8.3", "8.4" ]
steps:
# -------------------------------------------------
# 1) Checkout
# -------------------------------------------------
- name: Checkout repository
uses: actions/checkout@v4
# -------------------------------------------------
# 2) Setup PHP
# -------------------------------------------------
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer
coverage: none
extensions: openssl, sodium
# -------------------------------------------------
# 3) Validate composer.json
# -------------------------------------------------
- name: Validate composer.json
run: composer validate --strict
# -------------------------------------------------
# 4) Install dependencies
# -------------------------------------------------
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress
# -------------------------------------------------
# 5) Dump optimized autoload
# -------------------------------------------------
- name: Optimize autoload
run: composer dump-autoload --optimize
# -------------------------------------------------
# 6) Run PHPUnit
# -------------------------------------------------
- name: Run PHPUnit
run: composer test
# -------------------------------------------------
# 7) Run PHPStan
# -------------------------------------------------
- name: Run PHPStan
run: composer analyse
# -------------------------------------------------
# 8) Syntax Check
# -------------------------------------------------
- name: Lint PHP files
run: |
find . -type f -name "*.php" -not -path "./vendor/*" -print0 | xargs -0 -n1 php -l