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

DP-6244 enable coverity #528

Merged
merged 1 commit into from
Oct 26, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/tiiuae-coverity-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run coverity scan
run:
run: |
docker run --rm -v "$(pwd):/main_ws" ghcr.io/tiiuae/px4-coverity-scan-image:latest
- name: Update summary
run:
Expand Down
1 change: 1 addition & 0 deletions packaging/Dockerfile.coverity
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ RUN curl https://sig-repo.synopsys.com/artifactory/coverity-releases/2023.6.0/co
&& /coverity_install.sh -q --installation.dir=/cov --license.region=6 --license.agreement=agree --license.type.choice=0 --license.cov.path=/license.dat \
&& rm /coverity_install.sh

RUN apt update && apt install -y --no-install-recommends xmlstarlet
COPY px4-firmware/packaging/entrypoint_coverity.sh /
ENTRYPOINT [ "/entrypoint_coverity.sh" ]
2 changes: 1 addition & 1 deletion packaging/coverity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ capture:
commit:
connect:
auth-key-file: /auth_key.txt
stream: px4-coverity-test
stream: px4-coverity
url: https://coverity.ssrc.fi:443/
on-new-cert: trust
13 changes: 13 additions & 0 deletions packaging/entrypoint_coverity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ COVERITY_SCAN_OUT=/main_ws/cov-scan-output.txt
COVERITY_REPORT_OUT=/main_ws/coverity-output

cp /main_ws/packaging/coverity.yaml /main_ws/coverity.yaml
cd /main_ws
git config --global --add safe.directory '*'

export PATH=$PATH:/cov/bin/
cov-configure --gcc
Expand All @@ -29,4 +31,15 @@ echo '------' >> ${COVERITY_SUMMARY_OUT}

# save coverity html output
cov-format-errors --dir idir --html-output ${COVERITY_REPORT_OUT}

# github output to format table
echo "| checker | file |" >> ${COVERITY_SUMMARY_OUT}
echo "| ------- | ---- |" >> ${COVERITY_SUMMARY_OUT}

# findings from output xml, save error, filename and line number
# grep away files which begins with "/" as they are from the environment and not from the project
xmlstarlet sel -t -m "/coverity/error" -o "| " -v "checker" -o " | " -v "file" -o ":" -v "line" -o " |" -n ${COVERITY_REPORT_OUT}/index.xml | grep -v '.*[[:space:]]\/.*'>> ${COVERITY_SUMMARY_OUT}

# echo an empty line to end table formatting
echo '' >> ${COVERITY_SUMMARY_OUT}
echo 'for more details please check attached html report from "Artifacts" -sections above' >> ${COVERITY_SUMMARY_OUT}