qBittorrent/.github/workflows/coverity-scan.yaml

108 lines
3.4 KiB
YAML
Raw Normal View History

2021-08-07 18:07:27 +03:00
name: Coverity Scan
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.
permissions: {}
2021-08-07 18:07:27 +03:00
jobs:
coverity_scan:
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"
2021-08-07 18:07:27 +03:00
steps:
2021-08-14 09:54:15 +03:00
- name: Checkout repository
2023-09-05 14:42:07 +03:00
uses: actions/checkout@v4
2021-08-07 18:07:27 +03:00
2021-08-14 09:56:37 +03:00
- 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
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 }}"
2021-11-17 10:53:27 +03:00
- name: Install Qt
uses: jurplel/install-qt-action@v3
2021-11-17 10:53:27 +03:00
with:
version: ${{ matrix.qt_version }}
archives: icu qtbase qtdeclarative qtsvg qttools
cache: true
2021-08-07 18:07:27 +03:00
2021-08-14 09:56:37 +03:00
- name: Install libtorrent
run: |
2021-11-17 10:53:27 +03:00
git clone \
--branch v${{ matrix.libt_version }} \
2021-11-17 10:53:27 +03:00
--depth 1 \
--recurse-submodules \
https://github.com/arvidn/libtorrent.git \
${{ env.libtorrent_path }}
cd ${{ env.libtorrent_path }}
cmake \
-B build \
-G "Ninja" \
2021-11-17 10:53:27 +03:00
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBOOST_ROOT="${{ env.boost_path }}" \
-Ddeprecated-functions=OFF
cmake --build build
sudo cmake --install build
2021-08-07 18:07:27 +03:00
- 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
2021-08-07 18:07:27 +03:00
- name: Build qBittorrent
run: |
cmake \
-B build \
-G "Ninja" \
2021-11-17 10:53:27 +03:00
-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
2021-08-07 18:07:27 +03:00
- name: Submit the result to Coverity Scan
run: |
2023-06-25 10:45:18 +03:00
tar -caf qbittorrent.xz cov-int
curl \
--form token="${{ secrets.COVERITY_SCAN_TOKEN }}" \
--form email=sledgehammer999@qbittorrent.org \
2021-09-11 07:07:52 +03:00
--form file=@qbittorrent.xz \
--form version="$(git rev-parse --short HEAD)" \
--form description="master" \
https://scan.coverity.com/builds?project=qbittorrent%2FqBittorrent