Leuchtfeuer/locate

View on GitHub
.github/workflows/ci.yaml

Summary

Maintainability
Test Coverage
name: Continous Integration
on:
  push:
    branches:
      - master
      - 'v[0-9]+\.x'
  pull_request:

jobs:
  integration:
    name: Integration tests
    runs-on: ubuntu-22.04
    strategy:
      matrix:
        php-version: [8.1, 8.2]
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Setup PHP Environment
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-version }}
          tools: php-cs-fixer:3
      - name: Check PHP CS
        run: php-cs-fixer fix --config php-cs-fixer.php --dry-run --using-cache no --show-progress dots -vvv

  phpunit:
    needs: integration
    name: PHP ${{ matrix.php-version }} - T3 ${{ matrix.typo3-version }}
    runs-on: ubuntu-22.04
    continue-on-error: ${{ matrix.experimental }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - php-version: 8.1
            typo3-version: ^12.4
            experimental: false

          - php-version: 8.2
            typo3-version: ^12.4
            experimental: false
    env:
      PHP_VERSION: ${{ matrix.php-version }}
      TYPO3_VERSION: ${{ matrix.typo3-version }}

    steps:
      - name: Output Environment Data
        run: |
          echo "Running tests with TYPO3 ${TYPO3_VERSION} and PHP ${PHP_VERSION}"

      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 10

      - uses: shogo82148/actions-setup-mysql@v1
        with:
          mysql-version: '8.0'
          root-password: $3cret

      - name: Setup PHP Environment
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php-version }}
          extensions: fileinfo, gd, zip, zlib, openssl, intl, PDO, json, pcre, session, xml, filter, hash, mbstring, SPL, standard, mysqli
          ini-values: max_execution_time=240,memory_limit=256M
          tools: composer:v2

      - name: Get composer cache directory
        id: composer-cache
        run: echo "::set-output name=dir::$(composer config cache-files-dir)"

      - name: Cache dependencies
        uses: actions/cache@v2
        with:
          path: ${{ steps.composer-cache.outputs.dir }}
          key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
          restore-keys: ${{ runner.os }}-composer-

      - name: Install Dependencies
        env:
          PHP_VERSION: ${{ matrix.php-version }}
          TYPO3_VERSION: ${{ matrix.typo3-version }}
        run: |
          if [[ "${{ matrix.typo3-version }}" == *"dev"* ]]; then
            composer config minimum-stability dev
          fi

          composer req typo3/testing-framework typo3/cms-core:"${{ matrix.typo3-version }}" typo3/cms-backend:"${{ matrix.typo3-version }}" typo3/cms-extbase:"${{ matrix.typo3-version }}" typo3/cms-extensionmanager:"${{ matrix.typo3-version }}" typo3/cms-fluid:"${{ matrix.typo3-version }}" typo3/cms-frontend:"${{ matrix.typo3-version }}"
          export TYPO3_PATH_WEB=$PWD/.Build/web

      - name: Run PHPUnit
        run: |
          .Build/bin/phpunit --configuration Tests/Build/FunctionalTests.xml --coverage-clover=coverage.xml
          .Build/bin/phpunit --configuration Tests/Build/UnitTests.xml