From a4ac8e696e31f7b4f4fd81c1be042853495267d8 Mon Sep 17 00:00:00 2001 From: Caen De Silva <95144705+caendesilva@users.noreply.github.com> Date: Thu, 28 Apr 2022 12:59:15 +0200 Subject: [PATCH] Add more reporting outputs --- .github/workflows/test-coverage.yml | 62 +++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index f5dee0d..2874d6b 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -43,3 +43,65 @@ jobs: run: echo Result ${{ steps.run-coverage-parser.outputs.average_coverage }} - name: Post the result to server run: 'curl -X POST https://cdn.desilva.se/microservices/coverbadges/api.php -H "Content-Type: application/x-www-form-urlencoded" -d "repo=https://github.com/hydephp/hyde&value=${{ steps.run-coverage-parser.outputs.average_coverage }}&token=${{ secrets.COVERBADGES_SECRET }}"' + + create-coverage-report: + needs: update-coverage # If the previous job fails due to a test failure we don't need to try again + runs-on: ubuntu-latest + + steps: + - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e + with: + php-version: '8.0' + coverage: xdebug + extensions: fileinfo + - uses: actions/checkout@v2 + - name: Install Dependencies + run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + - name: Set Framework version to dev-master + run: composer require hyde/framework:dev-master + - name: Set environment to testing + run: echo "ENV=testing" > .env + - name: Run tests with HTML coverage reporting + run: vendor/bin/pest --coverage-html covrep + env: + ENV: testing + + - name: Upload the report as an artifact + uses: actions/upload-artifact@v1 + with: + name: 'report.txt' + path: 'report.txt' + + + output-coverage: + needs: update-coverage # If the previous job fails due to a test failure we don't need to try again + runs-on: ubuntu-latest + + steps: + - uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e + with: + php-version: '8.0' + coverage: xdebug + extensions: fileinfo + - uses: actions/checkout@v2 + - name: Install Dependencies + run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + - name: Set Framework version to dev-master + run: composer require hyde/framework:dev-master + - name: Set environment to testing + run: echo "ENV=testing" > .env + - name: Run tests with output coverage reporting + run: vendor/bin/pest --coverage + env: + ENV: testing + + - name: Upload the report as an artifact + uses: actions/upload-artifact@v1 + with: + name: 'report.txt' + path: 'report.txt' + + + + #create-php-docs: + # runs-on: ubuntu-latest