Skip to content

Commit

Permalink
GHA CI: fix coverity build failure
Browse files Browse the repository at this point in the history
PR #20129.
  • Loading branch information
Chocobo1 authored Dec 18, 2023
1 parent 073ca42 commit 4057972
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 20 deletions.
65 changes: 47 additions & 18 deletions .github/workflows/coverity-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ jobs:
name: Scan
runs-on: ubuntu-latest

strategy:
matrix:
libt_version: ["2.0.9"]
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
Expand All @@ -20,51 +31,69 @@ jobs:
run: |
sudo apt update
sudo apt install \
build-essential cmake ninja-build pkg-config \
libboost-dev libssl-dev zlib1g-dev
build-essential cmake ninja-build \
libssl-dev libxkbcommon-x11-dev libxcb-cursor-dev zlib1g-dev
- name: Install boost
run: |
curl \
-L \
-o "${{ runner.temp }}/boost.tar.gz" \
"https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.gz"
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."
mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: "6.5.2"
archives: icu qtbase qtsvg qttools
version: ${{ matrix.qt_version }}
archives: icu qtbase qtdeclarative qtsvg qttools
cache: true

- name: Install libtorrent
run: |
git clone \
--branch "v2.0.9" \
--branch v${{ matrix.libt_version }} \
--depth 1 \
--recurse-submodules \
https://github.com/arvidn/libtorrent.git
cd libtorrent
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: |
wget \
-q \
https://scan.coverity.com/download/linux64 \
--post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=qbittorrent%2FqBittorrent" \
-O coverity_tool.tgz
mkdir coverity_tool
tar xzf coverity_tool.tgz --strip 1 -C coverity_tool
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 \
-DGUI=ON \
-DVERBOSE_CONFIGURE=ON
export PATH="$(pwd)/coverity_tool/bin:$PATH"
cov-build --dir cov-int cmake --build build
-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: |
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
qBittorrent - A BitTorrent client in Qt
------------------------------------------

[![AppVeyor Status](https://ci.appveyor.com/api/projects/status/github/qbittorrent/qBittorrent?branch=master&svg=true)](https://ci.appveyor.com/project/qbittorrent/qBittorrent)
[![GitHub Actions CI Status](https://github.com/qbittorrent/qBittorrent/workflows/GitHub%20Actions%20CI/badge.svg)](https://github.com/qbittorrent/qBittorrent/actions)
[![GitHub Actions CI Status](https://github.com/qbittorrent/qBittorrent/actions/workflows/ci_ubuntu.yaml/badge.svg)](https://github.com/qbittorrent/qBittorrent/actions)
[![Coverity Status](https://scan.coverity.com/projects/5494/badge.svg)](https://scan.coverity.com/projects/5494)
********************************
### Description:
Expand Down

0 comments on commit 4057972

Please sign in to comment.