Skip to content

feat: add new authenticator transport constants and deprecate AUTHENTICATOR_TRANSPORT_CABLE #19

feat: add new authenticator transport constants and deprecate AUTHENTICATOR_TRANSPORT_CABLE

feat: add new authenticator transport constants and deprecate AUTHENTICATOR_TRANSPORT_CABLE #19

Workflow file for this run

name: 📁 PHP CI & Docker Build
on:
push:
branches: [main]
tags: ['*']
pull_request: ~
workflow_dispatch: ~
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
pre_checks:
name: "0️⃣ Pre-checks"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Check file permissions"
run: |
NON_EXECUTABLE=$(find . -type f -not -path './.git/*' -not -path './bin/console' -not -path './frankenphp/docker-entrypoint.sh' -not -path './link' -executable)
if [[ -n "$NON_EXECUTABLE" ]]; then
echo "Found non-executable files with executable permission:"
echo "$NON_EXECUTABLE"
exit 1
fi
- name: "Find non-printable ASCII characters"
run: |
if LC_ALL=C.UTF-8 find . -type f -name "*.php" -print0 | xargs -0 grep -PHn "[[:cntrl:]]"; then
echo "Non-printable ASCII characters found"
exit 1
fi
prepare_dependencies:
name: "📦 Prepare Composer Dependencies"
needs: [pre_checks]
runs-on: ubuntu-latest
container:
image: ghcr.io/spomky-labs/phpqa:8.4
outputs:
cache-key: ${{ steps.cache-key-generator.outputs.key }}
steps:
- uses: actions/checkout@v4
- id: cache-key-generator
run: echo "key=composer-${{ runner.os }}-${{ hashFiles('composer.lock') }}" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: |
vendor
~/.composer/cache
key: ${{ steps.cache-key-generator.outputs.key }}
restore-keys: |
composer-${{ runner.os }}-
- uses: ramsey/composer-install@v3
with:
dependency-versions: highest
composer-options: --optimize-autoloader
phpstan:
name: "1️⃣ Static Analysis (PHPStan)"
needs: [prepare_dependencies]
runs-on: ubuntu-latest
container:
image: ghcr.io/spomky-labs/phpqa:8.4
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
vendor
~/.composer/cache
key: ${{ needs.prepare_dependencies.outputs.cache-key }}
- run: castor phpstan
ecs:
name: "2️⃣ Coding Standards (ECS)"
needs: [prepare_dependencies]
runs-on: ubuntu-latest
container:
image: ghcr.io/spomky-labs/phpqa:8.4
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
vendor
~/.composer/cache
key: ${{ needs.prepare_dependencies.outputs.cache-key }}
- run: castor ecs
rector:
name: "3️⃣ Refactoring (Rector)"
needs: [prepare_dependencies]
runs-on: ubuntu-latest
container:
image: ghcr.io/spomky-labs/phpqa:8.4
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
vendor
~/.composer/cache
key: ${{ needs.prepare_dependencies.outputs.cache-key }}
- run: castor rector
validate:
name: "4️⃣ Validate composer.json"
needs: [prepare_dependencies]
runs-on: ubuntu-latest
container:
image: ghcr.io/spomky-labs/phpqa:8.4
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
vendor
~/.composer/cache
key: ${{ needs.prepare_dependencies.outputs.cache-key }}
- run: |
composer dump-autoload --optimize --strict-psr
composer validate --strict
composer normalize --dry-run --diff || true
lint:
name: "5️⃣ Syntax Check"
needs: [prepare_dependencies]
runs-on: ubuntu-latest
container:
image: ghcr.io/spomky-labs/phpqa:8.4
steps:
- uses: actions/checkout@v4
- run: composer exec -- parallel-lint src tests
check_licenses:
name: "6️⃣ License Check"
needs: [prepare_dependencies]
runs-on: ubuntu-latest
container:
image: ghcr.io/spomky-labs/phpqa:8.4
steps:
- uses: actions/checkout@v4
- run: castor check-licenses
deptrac:
name: "7️⃣ Architecture Layer Check (Deptrac)"
needs: [prepare_dependencies]
runs-on: ubuntu-latest
container:
image: ghcr.io/spomky-labs/phpqa:8.4
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
vendor
~/.composer/cache
key: ${{ needs.prepare_dependencies.outputs.cache-key }}
- run: castor deptrac
tests:
name: "🧪 Unit & Functional Tests (PHP ${{ matrix.php-version }})"
needs:
- prepare_dependencies
- phpstan
- ecs
- rector
- lint
- validate
- check_licenses
- deptrac
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php-version: '8.2'
- php-version: '8.3'
- php-version: '8.4'
container:
image: ghcr.io/spomky-labs/phpqa:${{ matrix.php-version }}
env:
XDEBUG_MODE: coverage
PHP_VERSION: ${{ matrix.php-version }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
if [ "${{ matrix.lowest-deps || 'false' }}" = "true" ]; then
composer update --prefer-lowest --no-interaction --no-progress
else
composer install --no-interaction --no-progress
fi
- name: Run PHPUnit
run: castor phpunit
js_lint:
name: "9️⃣ JS Lint"
needs: [prepare_dependencies]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Détecte un lockfile (package-lock.json ou npm-shrinkwrap.json)
- name: Detect npm lockfile
id: npm_lock
run: |
if [ -f package-lock.json ]; then
echo "path=package-lock.json" >> "$GITHUB_OUTPUT"
elif [ -f npm-shrinkwrap.json ]; then
echo "path=npm-shrinkwrap.json" >> "$GITHUB_OUTPUT"
else
echo "path=" >> "$GITHUB_OUTPUT"
fi
# Avec cache si lockfile présent
- name: Setup Node.js (with cache)
if: ${{ steps.npm_lock.outputs.path != '' }}
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: ${{ steps.npm_lock.outputs.path }}
# Sans cache si pas de lockfile
- name: Setup Node.js (no cache)
if: ${{ steps.npm_lock.outputs.path == '' }}
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install Node dependencies
run: |
if [ -f package-lock.json ]; then
npm ci
else
npm i --no-audit --no-fund
fi
- name: ESLint (check)
run: npm run lint
js_format:
name: "🔟 JS Format (check)"
needs: [prepare_dependencies]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Detect npm lockfile
id: npm_lock
run: |
if [ -f package-lock.json ]; then
echo "path=package-lock.json" >> "$GITHUB_OUTPUT"
elif [ -f npm-shrinkwrap.json ]; then
echo "path=npm-shrinkwrap.json" >> "$GITHUB_OUTPUT"
else
echo "path=" >> "$GITHUB_OUTPUT"
fi
- name: Setup Node.js (with cache)
if: ${{ steps.npm_lock.outputs.path != '' }}
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: ${{ steps.npm_lock.outputs.path }}
- name: Setup Node.js (no cache)
if: ${{ steps.npm_lock.outputs.path == '' }}
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install Node dependencies
run: |
if [ -f package-lock.json ]; then
npm ci
else
npm i --no-audit --no-fund
fi
- name: Prettier (check)
run: npm run format
js_tests:
name: "🧪 JS Tests"
needs:
- js_lint
- js_format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Detect npm lockfile
id: npm_lock
run: |
if [ -f package-lock.json ]; then
echo "path=package-lock.json" >> "$GITHUB_OUTPUT"
elif [ -f npm-shrinkwrap.json ]; then
echo "path=npm-shrinkwrap.json" >> "$GITHUB_OUTPUT"
else
echo "path=" >> "$GITHUB_OUTPUT"
fi
- name: Setup Node.js (with cache)
if: ${{ steps.npm_lock.outputs.path != '' }}
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: ${{ steps.npm_lock.outputs.path }}
- name: Setup Node.js (no cache)
if: ${{ steps.npm_lock.outputs.path == '' }}
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install Node dependencies
run: |
if [ -f package-lock.json ]; then
npm ci
else
npm i --no-audit --no-fund
fi
- name: Run JS tests
run: npm run test
infection:
name: "🧬 Mutation Testing"
needs: [tests]
if: ${{ endsWith(github.ref_name, '.x') }}
runs-on: ubuntu-latest
container:
image: ghcr.io/spomky-labs/phpqa:8.4
env:
XDEBUG_MODE: coverage
steps:
- uses: actions/checkout@v4
- name: Execute Infection
run: castor infect
exported_files:
name: "8️⃣ Exported Files Check"
needs: [prepare_dependencies]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check exported files
run: |
EXPECTED="CODE_OF_CONDUCT.md,LICENSE,README.md,RELEASES.md,SECURITY.md,composer.json"
CURRENT=$(git archive HEAD | tar --list | grep -v '/$' | grep -Ev '^(assets|bin|config|fixtures|frankenphp|migrations|public|src|templates|translations)/' | sort | paste -sd "," -)
echo "CURRENT = ${CURRENT}"
echo "EXPECTED = ${EXPECTED}"
if [[ "$CURRENT" != "$EXPECTED" ]]; then
echo "❌ Exported files do not match expected list"
exit 1
fi