Skip to content

Commit

Permalink
Revise README
Browse files Browse the repository at this point in the history
  • Loading branch information
akirakw committed Oct 3, 2023
1 parent 5c00e1d commit d27b088
Showing 1 changed file with 69 additions and 4 deletions.
73 changes: 69 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,77 @@
# tsurugi-annotations-action

This GitHub action generates check-run annotations from outputs of static analysis tools.
This GitHub action generates check-run annotations from outputs of static analysis tools and testing frameworks.

It is mainly focused on CI inside project-tsurugi projects, but can be used for other projects as well.

## Prerequisites

- Grant permissions for the GITHUB_TOKEN
- scope: checks
- access: write

```yaml

jobs:
Build:
permissions:
checks: write
...
```

## Usage

Simple usage
```yaml
steps:
- id: Generate_Annotations
name: Generate_Annotations
uses: ./.github/actions/tsurugi-annotations-action
- name: Verify
uses: project-tsurugi/tsurugi-annotations-action@v1
```
With configurations
```yaml
steps:

- name: Verify
uses: project-tsurugi/tsurugi-annotations-action@v1
if: always()
with:
junit_input: 'java/cost-accounting-benchmark/build/test-results/**/TEST-*.xml'
junit_test_src_dir: 'java/cost-accounting-benchmark/src/test/java'
spotbugs_input: 'java/cost-accounting-benchmark/build/reports/spotbugs/main/*.xml'
```
## Output
- Generate Check Run If there are warnings output by supporting tools/frameworks.
- example: https://github.com/project-tsurugi/sharksfin/runs/17161949649
- Generate Job Summary if warnings present.
- example: https://github.com/project-tsurugi/sharksfin/actions/runs/6320027242/attempts/1#summary-17161928275
## Supporting tools/frameworks
- [Clang-Tidy](https://clang.llvm.org/extra/clang-tidy/)
- [CTest](https://cmake.org/cmake/help/latest/manual/ctest.1.html)
- [Doxygen](https://www.doxygen.nl/)
- [Junit](https://junit.org/)
- [SpotBugs](https://spotbugs.github.io/)
- [Checkstyle](https://checkstyle.sourceforge.io/)
## Configurations (Actions input)
| Name | Type | Default | Description |
|--------------------|---------|-------------|------------------------------------|
| `github_token` | string | `${{ github.token }}` | Use this if you wish to use a different GitHub token than the one provided by the workflow. |
| `strict` | bool | `true` | If annotation exists, set action to fail. |
| `clang_tidy_input` | bool | `build/clang-tidy.log` | input file of generating Clang-Tidy annotation. |
| `ctest_input` | bool | `build/**/*_gtest_result.xml` | input file of generating CTest annotation. |
| `doxygen_input` | bool | `build/doxygen-error.log` | input file of generating Doxygen annotation. |
| `junit_input` | bool | `build/test-results/**/TEST-*.xml` | input file of generating JUnit annotation. |
| `spotbugs_input` | bool | `build/reports/spotbugs/main/*.xml` | input file of generating SpotBugs annotation. |
| `checkstyle_input` | bool | `build/reports/checkstyle/main.xml` | input file of generating SpotBugs annotation. |
| `junit_test_src_dir` | bool | `src/test/java` | test source root directory. |
| `matrix` | bool | `false` | matrix context. |
| `checker` | bool | `` (Search for all supporting tool outputs) | enabled checker list (comma separated string) |

## License

[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)

0 comments on commit d27b088

Please sign in to comment.