2021-08-07 18:07:27 +03:00
|
|
|
name: Coverity Scan
|
2021-08-12 20:49:47 +03:00
|
|
|
|
2021-08-07 18:07:27 +03:00
|
|
|
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.
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
coverity_scan:
|
|
|
|
name: Scan
|
2022-08-10 16:47:33 +03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2021-08-07 18:07:27 +03:00
|
|
|
steps:
|
2021-08-14 09:54:15 +03:00
|
|
|
- name: Checkout repository
|
2022-03-02 22:39:35 +03:00
|
|
|
uses: actions/checkout@v3
|
2021-08-07 18:07:27 +03:00
|
|
|
|
2021-08-14 09:56:37 +03:00
|
|
|
- name: Install dependencies
|
2021-08-12 20:49:47 +03:00
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install \
|
2021-09-23 07:38:52 +03:00
|
|
|
build-essential cmake ninja-build pkg-config \
|
2021-11-17 10:53:27 +03:00
|
|
|
libboost-dev libssl-dev zlib1g-dev
|
|
|
|
|
|
|
|
- name: Install Qt
|
2022-08-18 06:44:40 +03:00
|
|
|
uses: jurplel/install-qt-action@v3
|
2021-11-17 10:53:27 +03:00
|
|
|
with:
|
2022-10-03 07:02:10 +03:00
|
|
|
version: "6.4.0"
|
2022-10-09 10:24:30 +03:00
|
|
|
archives: icu qtbase qtsvg qttools
|
2021-08-07 18:07:27 +03:00
|
|
|
|
2021-08-14 09:56:37 +03:00
|
|
|
- name: Install libtorrent
|
2021-08-12 20:49:47 +03:00
|
|
|
run: |
|
2021-11-17 10:53:27 +03:00
|
|
|
git clone \
|
2022-10-25 07:44:57 +03:00
|
|
|
--branch "v2.0.8" \
|
2021-11-17 10:53:27 +03:00
|
|
|
--depth 1 \
|
|
|
|
--recurse-submodules \
|
|
|
|
https://github.com/arvidn/libtorrent.git
|
2021-08-12 21:14:48 +03:00
|
|
|
cd libtorrent
|
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
2021-11-17 10:53:27 +03:00
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
2021-08-12 20:49:47 +03:00
|
|
|
-Ddeprecated-functions=OFF
|
2021-08-12 21:14:48 +03:00
|
|
|
cmake --build build
|
2021-09-23 07:38:52 +03:00
|
|
|
sudo cmake --install build
|
2021-08-07 18:07:27 +03:00
|
|
|
|
2021-08-12 20:49:47 +03:00
|
|
|
- name: Download Coverity Build Tool
|
|
|
|
run: |
|
2021-08-12 21:14:48 +03:00
|
|
|
wget \
|
|
|
|
-q \
|
|
|
|
https://scan.coverity.com/download/linux64 \
|
2021-09-23 07:38:52 +03:00
|
|
|
--post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=qbittorrent%2FqBittorrent" \
|
2021-08-12 21:14:48 +03:00
|
|
|
-O coverity_tool.tgz
|
2021-08-12 20:49:47 +03:00
|
|
|
mkdir coverity_tool
|
|
|
|
tar xzf coverity_tool.tgz --strip 1 -C coverity_tool
|
2021-08-07 18:07:27 +03:00
|
|
|
|
2021-10-03 11:09:09 +03:00
|
|
|
- name: Build qBittorrent
|
2021-08-12 20:49:47 +03:00
|
|
|
run: |
|
2021-08-12 21:14:48 +03:00
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
2021-11-17 10:53:27 +03:00
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
2021-08-12 20:49:47 +03:00
|
|
|
-DGUI=ON \
|
2022-10-04 10:48:15 +03:00
|
|
|
-DQT6=ON \
|
2021-08-12 20:49:47 +03:00
|
|
|
-DVERBOSE_CONFIGURE=ON
|
2021-08-12 21:42:44 +03:00
|
|
|
export PATH="$(pwd)/coverity_tool/bin:$PATH"
|
2021-08-12 20:49:47 +03:00
|
|
|
cov-build --dir cov-int cmake --build build
|
2021-08-07 18:07:27 +03:00
|
|
|
|
2021-08-12 20:49:47 +03:00
|
|
|
- name: Submit the result to Coverity Scan
|
|
|
|
run: |
|
|
|
|
tar caf qbittorrent.xz cov-int
|
|
|
|
curl \
|
2021-09-23 07:38:52 +03:00
|
|
|
--form token="${{ secrets.COVERITY_SCAN_TOKEN }}" \
|
2021-08-12 20:49:47 +03:00
|
|
|
--form email=sledgehammer999@qbittorrent.org \
|
2021-09-11 07:07:52 +03:00
|
|
|
--form file=@qbittorrent.xz \
|
2021-08-12 21:42:44 +03:00
|
|
|
--form version="$(git rev-parse --short HEAD)" \
|
2021-08-12 20:49:47 +03:00
|
|
|
--form description="master" \
|
|
|
|
https://scan.coverity.com/builds?project=qbittorrent%2FqBittorrent
|