Bump to 4.4.0beta3
[qBittorrent.git] / .github / workflows / coverity-scan.yml
blob2a3fdf2f9b70122a15e4f00c9b44e1c53c8fe84d
1 name: Coverity Scan
3 on:
4   schedule:
5     - cron: '0 0 1 * *' # Monthly (1st day of month at midnight)
6   workflow_dispatch: # Mainly for testing. Don't forget the Coverity usage limits.
8 env:
9   LIBTORRENT_VERSION_TAG: v1.2.14
11 jobs:
12   coverity_scan:
13     name: Scan
14     runs-on: ubuntu-20.04
15     steps:
16       - name: Checkout repository
17         uses: actions/checkout@v2
19       - name: Install dependencies
20         run: |
21           sudo apt update
22           sudo apt install \
23             build-essential cmake git ninja-build pkg-config \
24             libssl-dev zlib1g-dev libboost-dev libboost-system-dev
25         # sudo apt install libqt5svg5-dev qtbase5-dev qttools5-dev # the Qt version in the standard repositories is too old...
27       # this will be installed under /opt/qt515. CMake will still find it automatically without additional hints
28       # to speed up the process, only the required components are installed rather than the full qt515-meta-full metapackage
29       - name: Install Qt
30         run: |
31           sudo add-apt-repository ppa:beineri/opt-qt-5.15.2-focal
32           sudo apt install \
33             qt515base qt515svg qt515tools
35       - name: Install libtorrent
36         run: |
37           git clone https://github.com/arvidn/libtorrent
38           cd libtorrent
39           git checkout ${{ env.LIBTORRENT_VERSION_TAG }}
40           cmake \
41             -B build \
42             -G "Ninja" \
43             -DCMAKE_BUILD_TYPE=Release \
44             -Ddeprecated-functions=OFF
45           cmake --build build
46           sudo cmake --install build --prefix /usr/local
48       - name: Download Coverity Build Tool
49         run: |
50           wget \
51             -q \
52             https://scan.coverity.com/download/linux64 \
53             --post-data "token=$TOKEN&project=qbittorrent%2FqBittorrent" \
54             -O coverity_tool.tgz
55           mkdir coverity_tool
56           tar xzf coverity_tool.tgz --strip 1 -C coverity_tool
57         env:
58           TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
60       - name: Configure qBittorrent
61         run: |
62           cmake \
63             -B build \
64             -G "Ninja" \
65             -DCMAKE_BUILD_TYPE=Release \
66             -DGUI=ON \
67             -DVERBOSE_CONFIGURE=ON
69       - name: Build qBittorrent
70         run: |
71           export PATH="$(pwd)/coverity_tool/bin:$PATH"
72           cov-build --dir cov-int cmake --build build
74       - name: Submit the result to Coverity Scan
75         run: |
76           tar caf qbittorrent.xz cov-int
77           curl \
78             --form token=$TOKEN \
79             --form email=sledgehammer999@qbittorrent.org \
80             --form file=@qbittorrent.tgz \
81             --form version="$(git rev-parse --short HEAD)" \
82             --form description="master" \
83             https://scan.coverity.com/builds?project=qbittorrent%2FqBittorrent
84         env:
85           TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}