Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check-square

GitHub Action

tonybogdanov-coverage

v1.1

tonybogdanov-coverage

check-square

tonybogdanov-coverage

GitHub action to generate GitHub Pages for PHPUnit coverage

Installation

Copy and paste the following snippet into your .yml file.

              

- name: tonybogdanov-coverage

uses: TonyBogdanov/[email protected]

Learn more about this action in TonyBogdanov/coverage

Choose a version

Setup

Run your PHPUnit tests with:

--coverage-html=./path/to/coverage \
--coverage-clover ./path/to/coverage/coverage.xml

You can customize ./path/to/coverage, but make sure clover is generated in coverage.xml inside the folder.

Usage

Add the following step to your jobs:

- name: Coverage
  uses: TonyBogdanov/coverage@master
  with:
      path: ./path/to/coverage
      password: <optional password>

The password is optional, but if specified, all HTML files in the coverage will be cryptographically encoded with the specified password.

Example job

coverage:
    name: coverage

    needs: [ test ]
    runs-on: ubuntu-latest

    steps:
        - name: Checkout
          uses: actions/checkout@v1

        - name: Download artifacts
          uses: actions/download-artifact@v2
          with:
              name: coverage

        - name: Coverage
          uses: TonyBogdanov/coverage@master
          with:
              path: coverage
              password: coverage

        - name: Publish
          uses: JamesIves/github-pages-deploy-action@releases/v3
          with:
              ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
              BRANCH: gh-pages
              FOLDER: coverage