Coverity #9
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 | |
on: | |
repository_dispatch: | |
types: coverity_scan | |
schedule: | |
- cron: '0 0 * * 5' # Weekly at 00:00 UTC | |
env: | |
COVERITY_PROJECT: otland/forgottenserver | |
COVERITY_EMAIL: [email protected] | |
jobs: | |
scan: | |
runs-on: ubuntu-20.04 | |
if: github.repository == 'otland/forgottenserver' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: > | |
sudo apt-get install git cmake build-essential libluajit-5.1-dev libgmp3-dev libmysqlclient-dev | |
libboost-date-time-dev libboost-system-dev libboost-iostreams-dev libboost-filesystem-dev | |
libpugixml-dev libcrypto++-dev libfmt-dev | |
- name: Get latest CMake | |
# Using 'latest' branch, the latest CMake is installed. | |
uses: lukka/get-cmake@latest | |
- name: Download Coverity Build Tool | |
run: | | |
cd ${{ runner.workspace }} | |
wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=$COVERITY_PROJECT" -O cov-analysis-linux64.tar.gz | |
mkdir cov-analysis-linux64 | |
tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 | |
env: | |
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} | |
- name: Prepare build | |
run: | | |
mkdir build | |
cd build | |
cmake .. | |
- name: Build with cov-build | |
run: | | |
export PATH=${{ runner.workspace }}/cov-analysis-linux64/bin:$PATH | |
cd build | |
cov-build --dir ${{ runner.workspace }}/cov-int make -j2 | |
- name: Submit the result to Coverity Scan | |
run: | | |
cd ${{ runner.workspace }} | |
tar czvf forgottenserver.tgz cov-int | |
du -hs forgottenserver.tgz | |
curl \ | |
--form project=$COVERITY_PROJECT \ | |
--form token=$TOKEN \ | |
--form email=$COVERITY_EMAIL \ | |
--form [email protected] \ | |
--form version=$GITHUB_SHA \ | |
https://scan.coverity.com/builds?project=$COVERITY_PROJECT | |
env: | |
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} |