coverity-scan #176
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: coverity-scan | |
on: | |
push: | |
branches: | |
- coverity_scan | |
schedule: | |
- cron: '0 4 * * 2' # Tuesday at 4:00 UTC | |
jobs: | |
Coverity: | |
if: github.repository == 'CESNET/UltraGrid' || github.event.schedule == null | |
runs-on: ubuntu-latest | |
env: | |
SDK_URL: ${{ secrets.SDK_URL }} | |
coverity_token: ${{ secrets.coverity_token }} | |
steps: | |
- name: Get Coverity tool name # the file name contains version and is used as the cache key | |
if: ${{ env.coverity_token }} | |
id: tool | |
run: | | |
FILENAME=$(curl -LI "https://scan.coverity.com/download/linux64?token=$coverity_token&project=UltraGrid" | sed -n '/content-disposition/s/.*\"\(.*\)\"/\1/p') | |
echo "filename=$FILENAME" >> $GITHUB_OUTPUT | |
- name: Cache Coverity build tool | |
if: ${{ env.coverity_token }} | |
id: cache-coverity-tool | |
uses: actions/cache@main | |
with: | |
path: ~/coverity_tool.tgz | |
key: cache-coverity-tool-${{ steps.tool.outputs.filename }} | |
- name: Download Coverity build tool | |
if: steps.cache-coverity-tool.outputs.cache-hit != 'true' | |
run: | | |
wget --no-verbose https://scan.coverity.com/download/linux64 --post-data "token=$coverity_token&project=UltraGrid" -O ~/coverity_tool.tgz | |
- name: Extract Coverity build tool | |
if: ${{ env.coverity_token }} | |
run: | | |
tar xaf ~/coverity_tool.tgz | |
mv cov-analysis* /tmp/cov-analysis | |
- uses: actions/checkout@v4 | |
if: ${{ env.coverity_token }} | |
- name: Fetch SDKs ETags | |
if: ${{ env.coverity_token }} | |
id: etags | |
run: | | |
echo "ndi=$($GITHUB_WORKSPACE/.github/scripts/get-etags.sh https://downloads.ndi.tv/SDK/NDI_SDK_Linux/Install_NDI_SDK_v6_Linux.tar.gz)" >> $GITHUB_OUTPUT | |
- name: Cache NDI | |
if: ${{ env.coverity_token }} | |
id: cache-ndi | |
uses: actions/cache@main | |
with: | |
path: /var/tmp/Install_NDI_SDK_Linux.tar.gz | |
key: cache-ndi-${{ runner.os }}-${{ steps.etags.outputs.ndi }} | |
- name: Download NDI | |
if: ${{ env.coverity_token }} && steps.cache-ndi.outputs.cache-hit != 'true' | |
run: curl -L https://downloads.ndi.tv/SDK/NDI_SDK_Linux/Install_NDI_SDK_v6_Linux.tar.gz -o /var/tmp/Install_NDI_SDK_Linux.tar.gz | |
- name: bootstrap | |
run: | | |
. .github/scripts/environment.sh | |
.github/scripts/Linux/prepare.sh | |
sudo apt install libavcodec-dev libavformat-dev libswscale-dev libsdl2-mixer-dev libsdl2-ttf-dev | |
- name: configure | |
if: ${{ env.coverity_token }} | |
run: ./autogen.sh $FEATURES | |
- name: Build with cov-build | |
if: ${{ env.coverity_token }} | |
run: | | |
/tmp/cov-analysis/bin/cov-build --dir cov-int make -j2 | |
- name: Submit the result to Coverity Scan | |
if: ${{ env.coverity_token }} | |
run: | | |
tar caf ultragrid.tar.xz cov-int | |
result=$(curl -S --form token=$coverity_token \ | |
--form [email protected] \ | |
--form [email protected] \ | |
--form version="$(date +%F)" \ | |
--form description="master build" \ | |
https://scan.coverity.com/builds?project=UltraGrid) | |
echo "$result" | |
if ! expr "$result" : 'Build successfully submitted.' >/dev/null; then | |
exit 1 | |
fi | |
# vi: set expandtab sw=2: |