From 63332def030bbd303c608f88d124ee04a86720d9 Mon Sep 17 00:00:00 2001 From: Orkun Date: Tue, 3 Sep 2024 15:19:59 +0300 Subject: [PATCH] refactor: rename coverage.php to more explaining name and add comment what it does --- .github/workflows/coverage-diff.yml | 6 +++--- .github/workflows/coverage-report.yml | 2 +- contributing.md | 4 ++-- coverage.php => generate_coverage_report.php | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) rename coverage.php => generate_coverage_report.php (95%) diff --git a/.github/workflows/coverage-diff.yml b/.github/workflows/coverage-diff.yml index 517705c1..4d428f6c 100644 --- a/.github/workflows/coverage-diff.yml +++ b/.github/workflows/coverage-diff.yml @@ -32,7 +32,7 @@ jobs: - name: Create coverage report for PR id: pr_coverage run: | - php ./coverage.php + php ./generate_coverage_report.php COVERAGE_PR=$(jq -r '.total.statements.pct' cov/json/index.json) echo "COVERAGE_PR=$COVERAGE_PR" >> $GITHUB_ENV - name: Upload coverage report markdown @@ -67,8 +67,8 @@ jobs: run: | COVERAGE_BASE=0 - if [ -f "./coverage.php" ]; then - php ./coverage.php + if [ -f "./generate_coverage_report.php" ]; then + php ./generate_coverage_report.php fi if [ -f "cov/json/index.json" ]; then diff --git a/.github/workflows/coverage-report.yml b/.github/workflows/coverage-report.yml index 72e430f8..9a64d3a2 100644 --- a/.github/workflows/coverage-report.yml +++ b/.github/workflows/coverage-report.yml @@ -29,7 +29,7 @@ jobs: - name: PHPUnit run: docker-compose run --user "$(id -u):$(id -g)" phpunit - name: "Parse Coverage" - run: "php ./coverage.php" + run: "php ./generate_coverage_report.php" - name: Create Coverage Badges uses: jaywcjlove/coverage-badges-cli@df58615045079f1c827de7867044bbab3ec22b43 with: diff --git a/contributing.md b/contributing.md index 0b2720dc..826d7ea3 100644 --- a/contributing.md +++ b/contributing.md @@ -29,9 +29,9 @@ To generate a code coverage report, follow these steps: - The Clover XML report will be saved in `cov/xml/clover.xml`. - The HTML report will be saved in the `cov/html` directory. -2. To convert the Clover XML report into a markdown report, run the coverage.php script: +2. To convert the Clover XML report into a markdown report, run the generate_coverage_report.php script: ```shell - docker-compose run php php coverage.php + docker-compose run php php generate_coverage_report.php ``` The markdown report will be saved in the `cov/markdown/coverage_report.md` file. You can open this file to review the coverage details. diff --git a/coverage.php b/generate_coverage_report.php similarity index 95% rename from coverage.php rename to generate_coverage_report.php index 4a4b4c6d..98ad057b 100644 --- a/coverage.php +++ b/generate_coverage_report.php @@ -1,5 +1,7 @@