-
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add workflow for coverity scan
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: coverity-scan | ||
|
||
on: | ||
schedule: | ||
- cron: '0 1 * * *' # Once per day | ||
|
||
jobs: | ||
latest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: Download and install toxcore | ||
run: | ||
sudo apt-get update && | ||
sudo apt-get install -y --no-install-recommends | ||
libopus-dev | ||
libsodium-dev | ||
libvpx-dev | ||
|
||
git clone --recurse-submodules https://github.com/TokTok/c-toxcore.git | ||
cd c-toxcore | ||
mkdir _build && cd _build | ||
cmake -D BOOTSTRAP_DAEMON=OFF -D DHT_BOOTSTRAP=OFF .. | ||
cmake --build . && sudo make install | ||
cd .. | ||
|
||
- name: Install toxic libraries | ||
run: | ||
sudo apt-get update && | ||
sudp apt-get install -y --no-install-recommends | ||
libncursesw6-dev | ||
libconfig-dev | ||
libcurl4-openssl-dev | ||
libqrencode-dev | ||
libopenal-dev | ||
libalut-dev | ||
libnotify-dev | ||
python3-dev | ||
|
||
- name: Download Coverity Build Tool | ||
run: | | ||
wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=JFreegman/toxic" -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: Build toxic with cov-build | ||
run: cov-analysis-linux64/bin/cov-build --dir cov-int make ENABLE_TOX_EXPERIMENTAL=1 ENABLE_PYTHON=1 | ||
|
||
- name: Submit the result to Coverity Scan | ||
run: | ||
tar czvf toxic.tgz cov-int && | ||
curl | ||
--form project=JFreegman/toxic | ||
--form token=$TOKEN | ||
--form email=jfreegman@gmail.com | ||
--form file=@toxic.tgz | ||
--form version="$(git rev-list --count HEAD)" | ||
--form description="CI build of $(git rev-parse --abbrev-ref HEAD) branch" | ||
https://scan.coverity.com/builds | ||
env: | ||
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} |