|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + name: Build PHP/TYPO3 |
| 10 | + runs-on: ubuntu-latest |
| 11 | + strategy: |
| 12 | + fail-fast: false |
| 13 | + matrix: |
| 14 | + include: |
| 15 | + - php-versions: '8.1' |
| 16 | + typo3-versions: '^11' |
| 17 | + - php-versions: '8.1' |
| 18 | + typo3-versions: '^12' |
| 19 | + - php-versions: '8.2' |
| 20 | + typo3-versions: '^11' |
| 21 | + - php-versions: '8.2' |
| 22 | + typo3-versions: '^12' |
| 23 | + - php-versions: '8.2' |
| 24 | + typo3-versions: '^13' |
| 25 | + - php-versions: '8.3' |
| 26 | + typo3-versions: '^11' |
| 27 | + - php-versions: '8.3' |
| 28 | + typo3-versions: '^12' |
| 29 | + - php-versions: '8.3' |
| 30 | + typo3-versions: '^13' |
| 31 | + - php-versions: '8.4' |
| 32 | + typo3-versions: '^12' |
| 33 | + - php-versions: '8.4' |
| 34 | + typo3-versions: '^13' |
| 35 | + steps: |
| 36 | + - name: Check out repository |
| 37 | + uses: actions/checkout@v5 |
| 38 | + with: |
| 39 | + fetch-depth: 1 |
| 40 | + - name: Setup PHP version |
| 41 | + uses: shivammathur/setup-php@v2 |
| 42 | + with: |
| 43 | + php-version: ${{ matrix.php-versions }} |
| 44 | + extensions: mbstring |
| 45 | + - name: Get Composer Cache Directory |
| 46 | + id: composer-cache |
| 47 | + run: | |
| 48 | + echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 49 | + - name: Cache composer dependencies |
| 50 | + uses: actions/cache@v4 |
| 51 | + with: |
| 52 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 53 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 54 | + restore-keys: ${{ runner.os }}-composer- |
| 55 | + - name: Install composer dependencies |
| 56 | + run: | |
| 57 | + composer require typo3/cms-core=${{ matrix.typo3-versions }} --no-progress --prefer-dist --optimize-autoloader |
| 58 | + - name: Run PHP linter |
| 59 | + run: | |
| 60 | + find . -type f -name '*.php' ! -path "./.Build/*" -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" ) |
| 61 | + - name: Run unit tests |
| 62 | + run: | |
| 63 | + .Build/bin/phpunit -c Tests/phpunit.xml.dist |
| 64 | + code-quality: |
| 65 | + name: Code Quality |
| 66 | + runs-on: ubuntu-latest |
| 67 | + steps: |
| 68 | + - name: Check out repository |
| 69 | + uses: actions/checkout@v5 |
| 70 | + with: |
| 71 | + fetch-depth: 1 |
| 72 | + - name: Setup PHP version |
| 73 | + uses: shivammathur/setup-php@v2 |
| 74 | + with: |
| 75 | + php-version: 8.2 |
| 76 | + extensions: mbstring |
| 77 | + - name: Get Composer Cache Directory |
| 78 | + id: composer-cache |
| 79 | + run: | |
| 80 | + echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 81 | + - name: Cache composer dependencies |
| 82 | + uses: actions/cache@v4 |
| 83 | + with: |
| 84 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 85 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} |
| 86 | + restore-keys: ${{ runner.os }}-composer- |
| 87 | + - name: Install composer dependencies |
| 88 | + run: | |
| 89 | + composer --version |
| 90 | + composer update --no-progress --prefer-dist --optimize-autoloader |
| 91 | + - name: Verify PSR-4 namespace correctness |
| 92 | + run: | |
| 93 | + composer dumpautoload --optimize --strict-psr |
0 commit comments