blob: 2558e580691d9eaa4cf70329f64bd0354a4a6d4c [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
11
12 - name: Download Coverity Build Tool
13 shell: bash
14 working-directory: ${{ github.workspace }}
15 run: |
16 wget -q https://scan.coverity.com/download/linux64 --post-data "token=$TOKEN&project=CESNET%2Flibyang" -O coverity-tools.tar.gz
17 mkdir coverity-tools
18 tar xzf coverity-tools.tar.gz --strip 1 -C coverity-tools
19 env:
20 TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
21
22 - name: Fixed world writable dirs
23 run: |
24 chmod go-w $HOME
25 sudo chmod -R go-w /usr/share
26
27 - name: Configure
28 shell: bash
29 working-directory: ${{ github.workspace }}
30 run: |
31 mkdir build
32 cd build
33 CC=clang cmake -DCMAKE_BUILD_TYPE=Debug ..
34
35 - name: Build with cov-build
36 shell: bash
37 working-directory: ${{ github.workspace }}/build
38 run: |
39 export PATH=${{ github.workspace }}/coverity-tools/bin:$PATH
40 cov-build --dir cov-int make
41
42 - name: Submit the result to Coverity Scan
43 shell: bash
44 working-directory: ${{ github.workspace }}/build
45 run: |
46 tar czvf libyang.tgz cov-int
47 curl \
48 --form token=$TOKEN \
49 --form email=rkrejci@cesnet.cz \
50 --form file=@libyang.tgz \
51 --form version="`./yanglint -v | cut -d\" \" -f2`" \
52 --form description="libyang library" \
53 https://scan.coverity.com/builds?project=CESNET%2Flibyang
54 env:
55 TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}