Skip to content

Commit

Permalink
Merge pull request #1 from niwciu/develop
Browse files Browse the repository at this point in the history
html-out and html-theme inputs added
  • Loading branch information
niwciu authored Sep 10, 2024
2 parents 44f243a + 371238f commit 6619016
Show file tree
Hide file tree
Showing 6 changed files with 1,566 additions and 1,475 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,54 @@ jobs:
sample/include/is_odd.hpp
fail-under-line: 100

html-out-usage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Build Sample Project
uses: threeal/[email protected]
with:
source-dir: sample

- name: Test Sample Project
uses: threeal/[email protected]
with:
test-dir: sample/build

- name: Use this action to generate an HTML report
uses: ./
with:
html-out: coverage.html

- name: Check if that HTML report does exist
run: cat coverage.html

html-theme-usage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Build Sample Project
uses: threeal/[email protected]
with:
source-dir: sample

- name: Test Sample Project
uses: threeal/[email protected]
with:
test-dir: sample/build

- name: Use this action to generate an HTML report
uses: ./
with:
html-out: coverage.html
html-theme: github.dark-blue

- name: Check if that HTML report does exist
run: cat coverage.html
xml-out-usage:
runs-on: ubuntu-latest
steps:
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ For more information, see [action.yml](./action.yml) and [GitHub Actions guide](
| `gcov-executable` | Executable name with optional arguments | Use a particular [gcov](https://gcc.gnu.org/onlinedocs/gcc/Gcov.html) executable. Must match the compiler you are using, e.g. `llvm-cov gcov` for [LLVM Clang](https://clang.llvm.org/). See [this](https://gcovr.com/en/stable/guide/compiling.html#choosing-the-right-gcov-executable). |
| `excludes` | One or more regular expression | Exclude source files that match these filters. |
| `fail-under-line` | 0 - 100 | Fail if the total line coverage is less than this value. |
| `html-out` | Path | Output file of the generated HTML coverage report. |
| `html-theme` | `green` , `blue` , `github.blue` , `github.green` , `github.dark-green` , `github.dark-blue` | Override the default color theme for the HTML report. |
| `xml-out` | Path | Output file of the generated XML coverage report. |
| `coveralls-out` | Path | Output file of the generated [Coveralls API](https://docs.coveralls.io/api-introduction) coverage report. |
| `coveralls-send` | `true` or `false` | Send the generated Coveralls API coverage report to it's endpoint. Defaults to `false`. |
Expand Down Expand Up @@ -63,6 +65,25 @@ jobs:
src/internal/*
```
#### Output HTML Report
```yaml
- name: Generate a html code coverage report
uses: threeal/gcovr-action@xml-out
with:
html-out: coverage.html
```
#### Output HTML Report generated with a specific theme
```yaml
- name: Generate a html code coverage report
uses: threeal/gcovr-action@xml-out
with:
html-out: coverage.html
html-theme: github.green
```
#### Output XML Report
```yaml
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ inputs:
description: Exclude source files that match these filters
fail-under-line:
description: Fail if the total line coverage is less than this value
html-out:
description: Output file of the generated HTML coverage report
html-theme:
description: Override the default color theme for the HTML report. Default is green. Possible options green, blue, github.blue, github.green, github.dark-green, github.dark-blue
xml-out:
description: Output file of the generated XML coverage report
coveralls-out:
Expand Down
Loading

0 comments on commit 6619016

Please sign in to comment.