Skip to content

Commit

Permalink
[BUGFIX] Stabilize GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
eliashaeussler committed Oct 24, 2023
1 parent 4261f6f commit 6546895
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 21 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/cgl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
- main
- 'renovate/**'
pull_request:
branches:
- '**'
- '!renovate/**'

jobs:
cgl:
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
50 changes: 37 additions & 13 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
- main
- 'renovate/**'
pull_request:
branches:
- '**'
- '!renovate/**'

jobs:
tests:
Expand Down Expand Up @@ -109,29 +106,56 @@ 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
env:
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()

0 comments on commit 6546895

Please sign in to comment.