forked from canonical/snapd
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (58 loc) · 2 KB
/
coverity-scan.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Weekly Coverity scan of snap-confine
on:
# Run this action on a schedule (we're allowed a maximum of two per day)
schedule:
- cron: '0 0 * * Mon' # Monday at 00:00 UTC
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
coverity:
runs-on: ubuntu-22.04
environment: normal
if: github.repository == 'canonical/snapd'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# needed for git commit history
fetch-depth: 0
- name: Download Debian dependencies
run: |
sudo apt clean
sudo apt update
sudo apt build-dep -y .
- name: Get deps
run: |
./get-deps.sh
- name: Configure snap-confine
run: |
cd cmd/
./autogen.sh
- name: Download Coverity Build Tool
run: |
set -x
export TOKEN="${{ secrets.COVERITY_SCAN_TOKEN }}"
wget https://scan.coverity.com/download/cxx/linux64 --post-data "token=${TOKEN}&project=snap-confine" -O cov-analysis-linux64.tar.gz
mkdir cov-analysis-linux64
tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64
- name: Build with cov-build
run: |
export PATH=$(pwd)/cov-analysis-linux64/bin:$PATH
cd cmd/
cov-build --dir cov-int make -j$(nproc)
- name: Submit to Coverity Scan
run: |
set -x
export TOKEN="${{ secrets.COVERITY_SCAN_TOKEN }}"
cd cmd/
version=$(cat VERSION)
tarball="snap-confine-$version.tar.gz"
tar czvf "$tarball" cov-int
curl \
--form project=snap-confine \
--form token="$TOKEN" \
--form [email protected] \
--form file=@"$tarball" \
--form version="$version" \
--form description="snap-confine `git rev-parse --abbrev-ref HEAD` `git rev-parse --short HEAD`" \
https://scan.coverity.com/builds?project=snap-confine