Skip to content

[TASK] Switch our code coverage CI from Codacy to Coveralls #659

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

Merged
merged 1 commit into from
Aug 28, 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
35 changes: 25 additions & 10 deletions .github/workflows/codecoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ jobs:
runs-on: ubuntu-22.04

strategy:
fail-fast: false
matrix:
php-version: [ '7.4' ]
php-version:
- '7.4'
dependencies:
- highest

steps:
- name: Checkout
Expand All @@ -30,28 +34,39 @@ jobs:
tools: composer:v2
coverage: xdebug

- name: Show the Composer version
run: composer --version

- name: Show the Composer configuration
run: composer config --global --list

- name: Cache dependencies installed with composer
uses: actions/cache@v4
with:
path: ~/.cache/composer
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
key: php${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php-version }}-composer-
php${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-

- name: Install Composer dependencies
run: |
composer update --with-dependencies --no-progress;
if [[ "${{ matrix.dependencies }}" == 'lowest' ]]; then
DEPENDENCIES='--prefer-lowest';
else
DEPENDENCIES='';
fi;
composer install --no-progress;
composer update --with-dependencies --no-progress "${DEPENDENCIES}";
composer show;

- name: Run Tests
run: ./vendor/bin/phpunit --coverage-clover build/coverage/xml
run: composer ci:tests:coverage

- name: Show generated coverage files
run: ls -lah

- name: Upload coverage results to Codacy
- name: Upload coverage results to Coveralls
uses: coverallsapp/github-action@v2
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
if: "${{ env.CODACY_PROJECT_TOKEN != '' }}"
run: |
./vendor/bin/codacycoverage clover build/coverage/xml
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage.xml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/.php_cs.cache
/.phpunit.result.cache
/composer.lock
/coverage.xml
/phpstan.neon
/vendor/
!/.phive/phars.xml
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# PHP CSS Parser

[![Build Status](https://github.com/MyIntervals/PHP-CSS-Parser/workflows/CI/badge.svg?branch=main)](https://github.com/MyIntervals/PHP-CSS-Parser/actions/)
[![Coverage Status](https://coveralls.io/repos/github/MyIntervals/PHP-CSS-Parser/badge.svg?branch=main)](https://coveralls.io/github/MyIntervals/PHP-CSS-Parser?branch=main)

A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output as (optimized) CSS.

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"ext-iconv": "*"
},
"require-dev": {
"codacy/coverage": "^1.4.3",
"php-parallel-lint/php-parallel-lint": "^1.4.0",
"phpstan/extension-installer": "^1.4.2",
"phpstan/phpstan": "^1.11.11",
Expand Down Expand Up @@ -83,6 +82,7 @@
"ci:tests": [
"@ci:tests:unit"
],
"ci:tests:coverage": "phpunit --do-not-cache-result --coverage-clover=coverage.xml",
"ci:tests:sof": "phpunit --stop-on-failure --do-not-cache-result",
"ci:tests:unit": "phpunit --do-not-cache-result",
"fix:php": [
Expand All @@ -102,6 +102,7 @@
"ci:php:rector": "Checks the code for possible code updates and refactoring.",
"ci:static": "Runs all static code analysis checks for the code.",
"ci:tests": "Runs all dynamic tests (i.e., currently, the unit tests).",
"ci:tests:coverage": "Runs the unit tests with code coverage.",
"ci:tests:sof": "Runs the unit tests and stops at the first failure.",
"ci:tests:unit": "Runs all unit tests.",
"fix:php": "Autofixes all autofixable issues in the PHP code.",
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
beStrictAboutChangesToGlobalState="true"
beStrictAboutCoversAnnotation="true"
cacheResult="false"
colors="true"
forceCoversAnnotation="true"
Expand Down