Skip to content

Coverity

Coverity #20

Workflow file for this run

name: Coverity
on:
repository_dispatch:
types: coverity_scan
schedule:
- cron: '0 0 * * 5' # Weekly at 00:00 UTC
env:
COVERITY_PROJECT: MillhioreBT/forgottenserver-downgrade
COVERITY_EMAIL: sarahelizabetwesker@gmail.com
jobs:
scan:
runs-on: ubuntu-20.04
if: github.repository == 'MillhioreBT/forgottenserver-downgrade'
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: >
sudo apt update -q &&
sudo apt install -yq build-essential lua5.4 libmysqlclient-dev
libboost-system-dev libboost-iostreams-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-downgrade.tgz cov-int
du -hs forgottenserver-downgrade.tgz
curl \
--form project=$COVERITY_PROJECT \
--form token=$TOKEN \
--form email=$COVERITY_EMAIL \
--form file=@forgottenserver-downgrade.tgz \
--form version=$GITHUB_SHA \
https://scan.coverity.com/builds?project=$COVERITY_PROJECT
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}