Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: [4.x] codecov #2366

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/common/composer-install/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ runs:

- name: Install dependencies with Composer
env:
SYMFONY_REQUIRE: ${{ inputs.symfony-version }}
SYMFONY_REQUIRE: "${{ inputs.symfony-version }}.*"
run: composer update --no-interaction --no-progress ${{ inputs.composer-flags }}
shell: bash
59 changes: 45 additions & 14 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,45 +26,46 @@ jobs:
matrix:
include:
- php-version: 7.4
symfony-require: "5.4"
composer-flags: "--prefer-lowest"
doctrine-annotations: true
- php-version: 7.4
symfony-require: "5.4.*"
symfony-require: "5.4"
doctrine-annotations: true
- php-version: 8.0
symfony-require: "5.4.*"
symfony-require: "5.4"
doctrine-annotations: true
- php-version: 8.1
symfony-require: "5.4.*"
symfony-require: "5.4"
doctrine-annotations: true
- php-version: 8.3
symfony-require: "5.4.*"
symfony-require: "5.4"
doctrine-annotations: true
- php-version: 8.1
symfony-require: "6.4.*"
symfony-require: "6.4"
doctrine-annotations: true
- php-version: 8.3
symfony-require: "6.4.*"
symfony-require: "6.4"
doctrine-annotations: true
- php-version: 8.2
symfony-require: "7.0.*"
symfony-require: "7.0"
doctrine-annotations: false
- php-version: 8.3
symfony-require: "7.0.*"
symfony-require: "7.0"
doctrine-annotations: false
- php-version: 8.2
symfony-require: "7.1.*"
symfony-require: "7.1"
doctrine-annotations: false
- php-version: 8.3
symfony-require: "7.1.*"
symfony-require: "7.1"
doctrine-annotations: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Install PHP without coverage
- name: Install PHP with coverage
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
Expand All @@ -79,7 +80,37 @@ jobs:
composer-flags: ${{ matrix.composer-flags }}

- name: PHPUnit Tests
run: vendor/bin/phpunit --configuration phpunit.xml.dist --coverage-text
run: vendor/bin/phpunit --configuration phpunit.xml.dist --coverage-clover=coverage-${{ matrix.php-version }}-${{ matrix.symfony-require }}-${{ matrix.doctrine-annotations }}${{ matrix.composer-flags }}.xml --coverage-filter=src/

- uses: actions/upload-artifact@v4
if: ${{ matrix.php-version != '7.4' }}
with:
name: coverage-${{ matrix.php-version }}-${{ matrix.symfony-require }}-${{ matrix.doctrine-annotations }}${{ matrix.composer-flags }}
path: coverage*.xml
if-no-files-found: error
retention-days: 2

upload-to-codecov:
name: Upload Code Coverage
runs-on: ubuntu-22.04

needs: phpunit
timeout-minutes: 5

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Download artifacts
uses: actions/download-artifact@v4

- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

php-cs-fixer:
name: PHP-CS-Fixer
Expand All @@ -96,7 +127,7 @@ jobs:
with:
php-version: 8.3
tools: composer, flex
coverage: pcov
coverage: none

- name: Setup dependencies
uses: ./.github/workflows/common/composer-install
Expand All @@ -122,7 +153,7 @@ jobs:
with:
php-version: 8.3
tools: composer, flex
coverage: pcov
coverage: none

- name: Setup dependencies
uses: ./.github/workflows/common/composer-install
Expand Down
Loading