mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-04-05 15:04:57 +00:00
95 lines
3.3 KiB
YAML
95 lines
3.3 KiB
YAML
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 -LIf "https://scan.coverity.com/download/linux64\
|
|
?token=$coverity_token&project=UltraGrid" |
|
|
sed -n '/content-disposition/s/.*\"\(.*\)\"/\1/p')
|
|
echo "filename=$FILENAME" >> $GITHUB_OUTPUT
|
|
- name: Run actions/cache for 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: |
|
|
$GITHUB_WORKSPACE/.github/scripts/get-etag.sh ndi\
|
|
https://downloads.ndi.tv/SDK/NDI_SDK_Linux/Install_NDI_SDK_v6_Linux.\
|
|
tar.gz >> $GITHUB_OUTPUT
|
|
- name: Run actions/cache for 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 -Lf 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 libfluidsynth-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 -Sf --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:
|