name: CI — Lint & Test on: push: branches: [ main ] pull_request: branches: [ main ] permissions: contents: read jobs: # ── PHP Syntax Check ───────────────────────────────────────────── lint-php: name: PHP Lint (${{ matrix.php }}) runs-on: ubuntu-latest strategy: matrix: php: ['7.4', '8.1', '8.3'] steps: - uses: actions/checkout@v4 - name: Set up PHP ${{ matrix.php }} uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} tools: composer - name: Syntax check all PHP files run: find . -name '*.php' -not -path './vendor/*' -not -path './peptide-news-plugin/*' -print0 | xargs -0 -n1 php -l # ── PHPCS Coding Standards ─────────────────────────────────────── phpcs: name: PHPCS runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up PHP uses: shivammathur/setup-php@v2 with: php-version: '8.3' tools: composer - name: Install dependencies run: composer install --prefer-dist --no-progress - name: Run PHPCS run: vendor/bin/phpcs --standard=.phpcs.xml.dist # ── PHPUnit Tests ──────────────────────────────────────────────── phpunit: name: PHPUnit (${{ matrix.php }}) runs-on: ubuntu-latest strategy: matrix: php: ['7.4', '8.1', '8.3'] steps: - uses: actions/checkout@v4 - name: Set up PHP ${{ matrix.php }} uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} tools: composer coverage: xdebug - name: Install dependencies run: composer install --prefer-dist --no-progress - name: Run PHPUnit run: vendor/bin/phpunit --testdox # ── JavaScript Lint ────────────────────────────────────────────── lint-js: name: JS Lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Node uses: actions/setup-node@v4 with: node-version: '20' - name: Check JS syntax run: | for f in $(find . -name '*.js' -not -path './vendor/*' -not -path './node_modules/*' -not -path './peptide-news-plugin/*'); do node --check "$f" || exit 1 done