From 0ab366fae4563251ef37f122eca748c31c06722b Mon Sep 17 00:00:00 2001 From: Daryll Doyle Date: Mon, 14 Feb 2022 00:39:15 +0000 Subject: [PATCH] Run tests for coverage --- .github/workflows/codeclimate.yml | 9 +++++++-- composer.json | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeclimate.yml b/.github/workflows/codeclimate.yml index 4344d51..4392caa 100644 --- a/.github/workflows/codeclimate.yml +++ b/.github/workflows/codeclimate.yml @@ -22,13 +22,18 @@ jobs: - name: Install dependencies run: composer install --prefer-dist --no-progress + - name: Run test suite + run: composer run-script test:coverage + - name: Code Coverage env: - CODECLIMATE_REPORTER_ID: ${{ secrets.CODECLIMATE_REPORTER_ID }} + CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_REPORTER_ID }} + GIT_BRANCH: ${{ GITHUB_REF_NAME }} + GIT_COMMIT_SHA: ${{ GITHUB_SHA }} # Linux: https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 # macOS: https://codeclimate.com/downloads/test-reporter/test-reporter-latest-darwin-amd64 # @todo Regenerate reporter ID and move it to GitHub secrets (internal environment vars) run: | curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter chmod +x ./cc-test-reporter - ./cc-test-reporter after-build -r "$CODECLIMATE_REPORTER_ID" + ./cc-test-reporter after-build -t clover build/logs/clover.xml diff --git a/composer.json b/composer.json index 572d802..a60a984 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,8 @@ } ], "scripts": { - "test": "phpunit --no-coverage" + "test": "phpunit --no-coverage", + "test:coverage": "phpunit" }, "autoload": { "psr-4": {