add CI checks for coverity #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: FreeRTOS-Kernel Coverity Scan - GCC Posix Demo | |
on: [push, pull_request] | |
jobs: | |
POSIX-GCC: | |
name: Native GCC | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the FreeRTOS/FreeRTOS Repository | |
uses: actions/checkout@v3 | |
with: | |
ref: main | |
repository: FreeRTOS/FreeRTOS | |
submodules: 'recursive' | |
fetch-depth: 1 | |
# Checkout user pull request changes | |
- name: Checkout Pull Request | |
uses: actions/checkout@v3 | |
with: | |
path: ./FreeRTOS/Source | |
- name: Install GCC | |
shell: bash | |
run: | | |
sudo apt-get -y update | |
sudo apt-get -y install build-essential | |
- name: Install Coverity Build | |
shell: bash | |
env: | |
COVERITY_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} | |
run: | | |
wget -nv -qO- https://scan.coverity.com/download/linux64 --post-data "token=${COVERITY_TOKEN}&project=FreeRTOS-Kernel" | tar -zx --one-top-level=cov_scan --strip-components 1 | |
echo "cov_scan_path=$(pwd)/cov_scan/bin" >> $GITHUB_ENV | |
- name: Coverity Build & Upload for Scan | |
shell: bash | |
env: | |
COVERITY_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} | |
working-directory: FreeRTOS/Demo/Posix_GCC | |
run: | | |
export PATH="$PATH:${{env.cov_scan_path}}" | |
cov-build --dir cov-int make -j | |
tar czvf gcc_posix_fr_kernel.tgz cov-int | |
COV_SCAN_UPLOAD_STATUS = $(curl --form token=${COVERITY_TOKEN} \ | |
--form [email protected] \ | |
--form file=@gcc_posix_fr_kernel.tgz \ | |
--form version="Mainline" \ | |
--form description="GCC Posix Demo" \ | |
https://scan.coverity.com/builds?project=FreeRTOS-Kernel) | |
echo "${COV_SCAN_UPLOAD_STATUS}" | grep -q -e 'Build successfully submitted' || echo >&2 "Error submitting build for analysis: ${COV_SCAN_UPLOAD_STATUS}" |