Files
UltraGrid/.github/workflows/coverity-scan.yml
2023-01-09 12:09:03 +01:00

69 lines
2.4 KiB
YAML

name: coverity-scan
on:
push:
branches:
- coverity_scan
schedule:
- cron: '0 4 20 * *' # 20th 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@v3
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@v3
if: ${{ env.coverity_token }}
- name: bootstrap
if: ${{ env.coverity_token }}
run: .github/scripts/Linux/prepare.sh
- name: configure
if: ${{ env.coverity_token }}
run: ./autogen.sh --enable-qt --enable-plugins --with-live555=/usr/local
- 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=pulec@cesnet.cz \
--form file=@ultragrid.tar.xz \
--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: