Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(github): run CodeChecker on PRs #360

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion .github/workflows/distcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
- neuron
fail-fast: false
steps:
- uses: actions/checkout@v4
aws-nslick marked this conversation as resolved.
Show resolved Hide resolved

- name: Install Dependencies
run: |
sudo apt-get update -y
Expand All @@ -42,7 +44,6 @@ jobs:
# Install Neuron Runtime
sudo apt-get install aws-neuronx-runtime-lib -y

- uses: actions/checkout@v4
- name: Install Libfabric
run: |
# We're just doing distchecks, so it is fine if we
Expand Down Expand Up @@ -88,3 +89,31 @@ jobs:
with:
name: ${{ matrix.cc }}-config.log
path: config.log

- uses: actions/setup-python@v5
if: matrix.cc == 'clang'
with:
python-version: '3.9'

- name: Run CodeChecker
if: matrix.cc == 'clang'
uses: whisperity/codechecker-analysis-action@v1
id: codechecker
aws-nslick marked this conversation as resolved.
Show resolved Hide resolved
with:
# clean and rebuild so that compile_commands.json can be detected
build-command: "make clean && make"
ctu: true

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

- name: CodeChecker Pass Or Fail?
if: matrix.cc == 'clang' && ${{ steps.codechecker.outputs.warnings-in-diff == 'true' }}
shell: bash
run: |
echo "::error title=Static Analyzers Failed::Analysed commit(s) caused 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/) (LLVM/Clang Static Analysis) on every pull request.

## Licensing

Expand Down
Loading