Skip to content

Commit

Permalink
ci(github): run CodeChecker on PRs
Browse files Browse the repository at this point in the history
extend distcheck workflow to run a second build under CodeChecker and
report defects. Better configuration and fixes of reported defects will
follow in a separate series, so for now, do not fail CI based on the
existence of a report.
  • Loading branch information
aws-nslick committed Mar 11, 2024
1 parent 9d8a467 commit ac2839f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/distcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
- neuron
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Install Dependencies
run: |
sudo apt-get update -y
Expand Down Expand Up @@ -88,3 +93,24 @@ jobs:
with:
name: ${{ matrix.cc }}-config.log
path: config.log

- name: Run CodeChecker
uses: whisperity/codechecker-analysis-action@v1
id: codechecker
with:
# clean and rebuild so that compile_commands.json can be detected
build-command: "make clean && make"
ctu: true

- name: Save CodeChecker HTML output.
uses: actions/upload-artifact@v4
with:
name: "CodeChecker Bug Reports for ${{ matrix.sdk }} on ${{ matrix.cc }}"
path: ${{ steps.codechecker.outputs.result-html-dir }}/*.html

- name: Pass Or Fail?
if: ${{ steps.codechecker.outputs.warnings-in-diff == 'true' }}
shell: bash
run: |
echo "::error title=Static Analyzers Failed::Analysed commit(s) causd static analysis warnings"
exit 0
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ [email protected] with any additional questions or comments.
## Security issue notifications
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.

We run [CodeChecker](https://codechecker.readthedocs.io/en/latest/) (with cppcheck and clang checkers) on every pull request.

## Licensing

Expand Down

0 comments on commit ac2839f

Please sign in to comment.