Skip to content

Latest commit

 

History

History
42 lines (38 loc) · 1.52 KB

File metadata and controls

42 lines (38 loc) · 1.52 KB

GitHub Actions

The example below will run the testing-suite inside github actions for PHP versions 8.1 through 8.4 and specify whether PHPUnit should also be run depending on PHP version.

name: Testing Suite
on: [push]
jobs:
  PHP:
    strategy:
      matrix:
        php:
          - {version: 8.1, tasks: 'composer,jsonlint,xmllint,yamllint,phpcs,phplint,phpmd,phpstan,securitychecker_enlightn'}
          - {version: 8.2, tasks: 'composer,jsonlint,xmllint,yamllint,phpcs,phplint,phpmd,phpstan,securitychecker_enlightn'}
          - {version: 8.3}
          - {version: 8.4}
    runs-on: ubuntu-latest
    container:
      image: ${{ matrix.php.version == '8.1' && 'srcoder/development-php:php81-fpm' ||
        matrix.php.version == '8.2' && 'srcoder/development-php:php82-fpm' ||
        matrix.php.version == '8.3' && 'srcoder/development-php:php83-fpm' ||
        matrix.php.version == '8.4' && 'srcoder/development-php:php84-fpm' }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Install Dependencies
        run: |
          composer2 install --dev --prefer-dist --no-scripts --no-progress --optimize-autoloader --no-interaction -vvv
          composer2 show
        shell: bash

      - name: Run GrumPHP Tasks
        run: |
          runArguments=()
          if [[ "${{ matrix.php.tasks }}" ]]; then
            runArguments+=(--tasks="{{ matrix.php.tasks }}")
          fi
          composer2 exec -v grumphp -- run "${runArguments[@]}"
        shell: bash