add github action for coverity scan

This commit is contained in:
Duncan Overbruck 2020-04-18 14:36:14 +02:00
parent db1766986c
commit 537ef657d2
No known key found for this signature in database
GPG Key ID: 335C1D17EC3D6E35

54
.github/workflows/coverity-scan.yml vendored Normal file
View File

@ -0,0 +1,54 @@
# based on https://github.com/ruby/actions-coverity-scan/blob/282dd059/.github/workflows/coverity-scan.yml
name: coverity-scan
on:
schedule:
- cron: '0 18 * * *' # Daily at 18:00 UTC
jobs:
latest:
runs-on: ubuntu-latest
steps:
- name: Install libraries
run: |
set -x
sudo apt-get update
sudo apt-get install make pkgconf gcc libarchive-dev zlib1g-dev openssl-dev
- name: Checkout void-linux/xbps
run: |
git clone --depth=1 https://github.com/void-linux/xbps .
- name: Download Coverity Build Tool
run: |
wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=ruby" -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: Fixed world writable dirs
run: |
chmod go-w $HOME
sudo chmod -R go-w /usr/share
- name: Configure
run: ./configure
- name: Build with cov-build
run: |
export PATH=`pwd`/cov-analysis-linux64/bin:$PATH
cov-build --dir cov-int make
- name: Submit the result to Coverity Scan
run: |
tar czvf xbps.tgz cov-int
curl \
--form project=ruby \
--form token=$TOKEN \
--form email=github@voidlinux.org \
--form file=@xbps.tgz \
--form version=trunk \
--form description="" \
https://scan.coverity.com/builds?project=ruby
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}