diff --git a/.github/workflows/cgl.yaml b/.github/workflows/cgl.yaml index 30301934..7b603a23 100644 --- a/.github/workflows/cgl.yaml +++ b/.github/workflows/cgl.yaml @@ -5,9 +5,6 @@ on: - main - 'renovate/**' pull_request: - branches: - - '**' - - '!renovate/**' jobs: cgl: @@ -22,7 +19,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: 8.2 - tools: composer:v2, composer-require-checker, composer-unused + tools: composer:v2, composer-require-checker, composer-unused, cs2pr coverage: none # Validation @@ -31,12 +28,17 @@ jobs: # Install dependencies - name: Install Composer dependencies - run: composer update --no-progress --no-plugins --no-scripts + uses: ramsey/composer-install@v2 + with: + composer-options: --no-plugins --no-scripts # Check Composer dependencies - name: Check dependencies run: composer-require-checker check --config-file dependency-checker.json - - run: composer install --no-progress + - name: Reset composer.json + run: git checkout composer.json composer.lock + - name: Re-install Composer dependencies + uses: ramsey/composer-install@v2 - name: Check for unused dependencies run: composer-unused @@ -46,7 +48,7 @@ jobs: - name: Lint Editorconfig run: composer lint:editorconfig - name: Lint PHP - run: composer lint:php + run: composer lint:php -- --format=checkstyle | cs2pr - name: Lint TypoScript run: composer lint:typoscript @@ -72,5 +74,5 @@ jobs: run: yarn --cwd Resources/Private/Frontend lint:ts # Migration - - name: Run Rector migration + - name: Rector migration run: composer migration:rector -- --dry-run diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index a957765b..35444163 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -5,9 +5,6 @@ on: - main - 'renovate/**' pull_request: - branches: - - '**' - - '!renovate/**' jobs: tests: @@ -109,10 +106,41 @@ jobs: timeout_minutes: 10 command: ddev composer test:coverage - # Report coverage + # Upload artifact - name: Fix coverage path working-directory: .Build/coverage run: sed -i 's#/var/www/html#${{ github.workspace }}#g' clover.xml + - name: Upload coverage artifact + uses: actions/upload-artifact@v3 + with: + name: coverage + path: .Build/coverage/clover.xml + retention-days: 7 + + # Save acceptance reports + - uses: actions/upload-artifact@v3 + with: + name: acceptance-reports-coverage + path: .Build/log/acceptance-reports + if: failure() + + coverage-report: + name: Report test coverage + runs-on: ubuntu-latest + needs: coverage + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + # Download artifact + - name: Download coverage artifact + id: download + uses: actions/download-artifact@v3 + with: + name: coverage + + # CodeClimate - name: CodeClimate report uses: paambaati/codeclimate-action@v5.0.0 if: env.CC_TEST_REPORTER_ID @@ -120,18 +148,14 @@ jobs: CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} with: coverageLocations: | - ${{ github.workspace }}/.Build/coverage/clover.xml:clover + ${{ steps.download.outputs.download-path }}/clover.xml:clover + + # codecov - name: codecov report uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} - directory: .Build/coverage + files: | + ${{ steps.download.outputs.download-path }}/clover.xml fail_ci_if_error: true verbose: true - - # Save acceptance reports - - uses: actions/upload-artifact@v3 - with: - name: acceptance-reports-coverage - path: .Build/log/acceptance-reports - if: failure()