forked from qbittorrent/qBittorrent
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
115 lines (102 loc) · 4.17 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Coverity Scan
on:
schedule:
- cron: '0 0 1 * *' # Monthly (1st day of month at midnight)
workflow_dispatch: # Mainly for testing. Don't forget the Coverity usage limits.
permissions: {}
jobs:
coverity_scan:
name: Scan
runs-on: ubuntu-latest
strategy:
matrix:
libt_version: ["2.0.10"]
qbt_gui: ["GUI=ON"]
qt_version: ["6.5.2"]
env:
boost_path: "${{ github.workspace }}/../boost"
coverity_path: "${{ github.workspace }}/../coverity"
libtorrent_path: "${{ github.workspace }}/../libtorrent"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt update
sudo apt install \
build-essential cmake ninja-build \
libssl-dev libxkbcommon-x11-dev libxcb-cursor-dev zlib1g-dev
- name: Install boost
env:
BOOST_MAJOR_VERSION: "1"
BOOST_MINOR_VERSION: "85"
BOOST_PATCH_VERSION: "0"
run: |
boost_url="https://boostorg.jfrog.io/artifactory/main/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
boost_url2="https://sourceforge.net/projects/boost/files/boost/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
set +e
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url"
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
if [ "$_exitCode" -ne "0" ]; then
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2"
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
fi
mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: ${{ matrix.qt_version }}
archives: icu qtbase qtdeclarative qtsvg qttools
cache: true
- name: Install libtorrent
run: |
git clone \
--branch v${{ matrix.libt_version }} \
--depth 1 \
--recurse-submodules \
https://github.com/arvidn/libtorrent.git \
${{ env.libtorrent_path }}
cd ${{ env.libtorrent_path }}
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBOOST_ROOT="${{ env.boost_path }}" \
-Ddeprecated-functions=OFF
cmake --build build
sudo cmake --install build
- name: Download Coverity Build Tool
run: |
curl \
-L \
-d "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=qbittorrent%2FqBittorrent" \
-o "${{ runner.temp }}/coverity_tool.tgz" \
"https://scan.coverity.com/download/linux64"
mkdir -p ${{ env.coverity_path }}
tar \
-xf "${{ runner.temp }}/coverity_tool.tgz" \
-C "${{ env.coverity_path }}" \
--strip-components 1
- name: Build qBittorrent
run: |
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBOOST_ROOT="${{ env.boost_path }}" \
-DVERBOSE_CONFIGURE=ON \
-D${{ matrix.qbt_gui }}
PATH="${{ env.coverity_path }}/bin:$PATH" \
cov-build \
--dir cov-int \
cmake --build build
- name: Submit the result to Coverity Scan
run: |
tar -caf qbittorrent.xz cov-int
curl \
--form token="${{ secrets.COVERITY_SCAN_TOKEN }}" \
--form email=sledgehammer999@qbittorrent.org \
--form file=@qbittorrent.xz \
--form version="$(git rev-parse --short HEAD)" \
--form description="master" \
https://scan.coverity.com/builds?project=qbittorrent%2FqBittorrent