blob: 68311db508f976dbb9b37450d7e3b7de6b79756f [file] [log] [blame]
Radek Krejcif4d97292020-11-30 16:38:32 +01001name: coverity-scan
2on:
3 schedule:
4 - cron: '0 6 * * *' # Dayly at 06:00 UTC
5
6jobs:
7 coverity-scan:
8 runs-on: ubuntu-latest
9 steps:
10 - uses: actions/checkout@v1
Radek Krejci07179822020-12-09 21:18:17 +010011 with:
Michal Vasko0791e802021-05-27 10:29:14 +020012 ref: devel
Radek Krejcif4d97292020-11-30 16:38:32 +010013
14 - name: Download Coverity Build Tool
15 shell: bash
16 working-directory: ${{ github.workspace }}
17 run: |
18 wget -q https://scan.coverity.com/download/linux64 --post-data "token=$TOKEN&project=CESNET%2Flibyang" -O coverity-tools.tar.gz
19 mkdir coverity-tools
20 tar xzf coverity-tools.tar.gz --strip 1 -C coverity-tools
21 env:
22 TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
23
24 - name: Fixed world writable dirs
25 run: |
26 chmod go-w $HOME
27 sudo chmod -R go-w /usr/share
28
29 - name: Configure
30 shell: bash
31 working-directory: ${{ github.workspace }}
32 run: |
33 mkdir build
34 cd build
35 CC=clang cmake -DCMAKE_BUILD_TYPE=Debug ..
36
37 - name: Build with cov-build
38 shell: bash
39 working-directory: ${{ github.workspace }}/build
40 run: |
41 export PATH=${{ github.workspace }}/coverity-tools/bin:$PATH
42 cov-build --dir cov-int make
43
44 - name: Submit the result to Coverity Scan
45 shell: bash
46 working-directory: ${{ github.workspace }}/build
47 run: |
48 tar czvf libyang.tgz cov-int
49 curl \
50 --form token=$TOKEN \
51 --form email=rkrejci@cesnet.cz \
52 --form file=@libyang.tgz \
53 --form version="`./yanglint -v | cut -d\" \" -f2`" \
54 --form description="libyang library" \
55 https://scan.coverity.com/builds?project=CESNET%2Flibyang
56 env:
57 TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}