Skip to content

coverity-scan

coverity-scan #5

Workflow file for this run

#runs every friday
name: coverity-scan
on:
schedule:
- cron: '0 0 * * 5'
jobs:
coverity:
strategy:
fail-fast: false
matrix:
config:
- os: "ubuntu-latest"
cxx-compiler: g++
c-compiler: gcc
compiler-version: 11
build-type: Release
runs-on: ${{ matrix.config.os }}
steps:
- uses: actions/checkout@v3
- name: Install Compiler and Dependencies
shell: pwsh
run: |
sudo apt-get update
$compiler = "${{ matrix.config.cxx-compiler }}"
$version = "${{ matrix.config.compiler-version }}"
if ($version -ne 'default') {
sudo apt-get install "$compiler-$version" -y
echo "$compiler-$version --version"
}
sudo apt-get install libmysqlclient-dev -y
sudo apt-get install uuid-dev -y
$cmake_version = "3.16.2"
$cmake_archive = "cmake-$cmake_version-Linux-x86_64"
wget -q "https://github.com/Kitware/CMake/releases/download/v$cmake_version/$cmake_archive.tar.gz"
tar -xf "$cmake_archive.tar.gz"
chmod +x "$cmake_archive/bin/cmake"
echo "$Env:GITHUB_WORKSPACE/$cmake_archive/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# I'm to dumb to get coverity to work with non default compiler
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 800 --slave /usr/bin/g++ g++ /usr/bin/g++-11
- name: Download Coverity Build Tool
run: |
wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=polserver%2Fpolserver" -O cov-analysis-linux64.tar.gz
mkdir cov-analysis-linux64
tar xvzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
- name: Set env Coverity Build Tool
shell: pwsh
run: |
echo "$Env:GITHUB_WORKSPACE/cov-analysis-linux64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Build 3rd party libs
run: |
cd bin-build
cmake .. -DNO_PCH=1
cmake --build . --target libcurl
cmake --build . --target libantlr_ex
cmake --build . --target boost
cmake --build . --target kaitai
cmake --build . --target tinyxml
- name: Build with cov-build
run: |
cd bin-build
cov-configure --template --comptype gcc --compiler gcc
cmake ..
cov-build --dir cov-int make -j 2
- name: Submit the result to Coverity Scan
run: |
cd bin-build
tar czvf polserver.tgz cov-int
curl \
--form token=$TOKEN \
--form [email protected] \
--form [email protected] \
--form version=master \
--form description="polcore100" \
https://scan.coverity.com/builds?project=polserver%2Fpolserver
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
# - name: Upload Artefact
# uses: actions/upload-artifact@v1
# with:
# name: test
# path: bin-build/polserver.tgz