brainworxx/kreXX-TYPO3-Extension

View on GitHub
.github/workflows/php.yml

Summary

Maintainability
Test Coverage
name: Build

on:
  push:
    branches: [ main, develop, feature/*]
  pull_request:
    branches: [ main ]

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        env:
          - { php: 7.4, composer: 1, TYPO3: ^10.4, Aimeos: ^20, CodeClimate: no  }
          - { php: 8.0, composer: 2, TYPO3: ^11.5, Aimeos: ^21, CodeClimate: no  }
          - { php: 8.1, composer: 2, TYPO3: ^11.5, Aimeos: ^22, CodeClimate: no  }
          - { php: 8.2, composer: 2, TYPO3: ^11.5, Aimeos: ^22, CodeClimate: no  }
          - { php: 8.1, composer: 2, TYPO3: ^12.4, Aimeos: ^23, CodeClimate: no  }
          - { php: 8.2, composer: 2, TYPO3: ^12.4, Aimeos: ^23, CodeClimate: no  }
          - { php: 8.3, composer: 2, TYPO3: ^12.4, Aimeos: ^24, CodeClimate: no  }
          - { php: 8.3, composer: 2, TYPO3: ^13.4, Aimeos: ^24, CodeClimate: yes }

    steps:
    - name: Checkout
      uses: actions/checkout@v4

    - name: Install PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: ${{ matrix.env.php }}

    - name: Update Composer
      run: |
        sudo composer self-update --${{ matrix.env.composer }}
        sudo chown $USER $HOME/.composer

    - name: Validate composer.json and composer.lock
      run: composer validate --strict

    - name: Install TYPO3
      run: composer require --no-update "typo3/cms-core:${{ matrix.env.TYPO3 }}"

    - name: Install Aimeos
      run: composer require --no-update "aimeos/aimeos-typo3:${{ matrix.env.Aimeos }}"
      if: ${{ matrix.env.Aimeos != 'no' }}

    - name: Install dependencies
      run: composer install --prefer-dist --no-progress

    - name: Build
      run: composer test

    - name: Publish code coverage
      uses: paambaati/codeclimate-action@v8.0.0
      if: ${{ matrix.env.CodeClimate == 'yes' }}
      env:
        CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATEKEY }}