s2b/vite-asset-collector

View on GitHub
.github/workflows/tests.yaml

Summary

Maintainability
Test Coverage
name: tests

on: [ push, pull_request ]

jobs:
  lint:
    name: Source code linting
    runs-on: ubuntu-latest
    steps:
      -
        uses: actions/checkout@v4

      -
        name: Validate composer.json
        run: composer validate

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

      -
        name: Cache composer dependencies
        uses: actions/cache@v4
        with:
          path: ${{ steps.composer-cache.outputs.dir }}
          key: composer-

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

      -
        name: PHP Linting
        run: composer lint:php

      -
        name: Editorconfig Linting
        run: composer lint:editorconfig

      -
        name: Phpstan Linting
        run: composer lint:phpstan


  test:
    name: Testing (PHP ${{ matrix.php-version }}, TYPO3 ${{ matrix.typo3-version }})
    needs: lint

    strategy:
      fail-fast: false
      matrix:
        php-version: [8.3, 8.2, 8.1]
        typo3-version: ['^12', '^13', '^11']
        exclude:
          - php-version: 8.1
            typo3-version: '^13'

    uses: ./.github/workflows/_test.yaml
    with:
      php-version: ${{ matrix.php-version }}
      typo3-version: ${{ matrix.typo3-version }}
      unit-coverage-name: coverage-unit-${{ matrix.php-version }}-${{ matrix.typo3-version }}
      functional-coverage-name: coverage-functional-${{ matrix.php-version }}-${{ matrix.typo3-version }}

  coverage:
    needs:
      - test
    if: ${{ always() }}
    runs-on: ubuntu-latest
    steps:
      -
        uses: actions/checkout@v4

      -
        name: Download unit test coverage reports
        uses: actions/download-artifact@v4
        with:
          name: coverage-unit-8.3-^12

      -
        name: Download functional test coverage reports
        uses: actions/download-artifact@v4
        with:
          name: coverage-functional-8.3-^12

      -
        name: Upload coverage results to Coveralls
        uses: paambaati/codeclimate-action@v5.0.0
        env:
          CC_TEST_REPORTER_ID: 32807026fddd031a98d1371e6a9360c6bd30f7be0d4bb9a5516a93cd748d9b34
        with:
          coverageLocations: |
            clover.unit.xml:clover
            clover.functional.xml:clover