2021-08-19 11:21:34 +08:00
|
|
|
name: CI - Ubuntu
|
|
|
|
on: [pull_request, push]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
ci:
|
|
|
|
name: Build
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
|
|
|
|
strategy:
|
2021-10-24 00:57:50 +08:00
|
|
|
fail-fast: false
|
2021-08-19 11:21:34 +08:00
|
|
|
matrix:
|
2021-10-24 00:57:50 +08:00
|
|
|
libt_version: ["2.0.4", "1.2.14"]
|
2021-08-19 11:21:34 +08:00
|
|
|
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
2021-10-24 00:57:50 +08:00
|
|
|
qt_version: ["5.15.2", "6.2.0"]
|
|
|
|
exclude:
|
|
|
|
- libt_version: "1.2.14"
|
|
|
|
qt_version: "6.2.0"
|
2021-08-19 11:21:34 +08:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install \
|
2021-09-23 12:38:52 +08:00
|
|
|
build-essential cmake ninja-build pkg-config \
|
2021-10-24 00:57:50 +08:00
|
|
|
libboost-dev libssl-dev zlib1g-dev
|
2021-08-19 11:21:34 +08:00
|
|
|
|
2021-09-23 12:38:52 +08:00
|
|
|
- name: Setup ccache
|
|
|
|
uses: Chocobo1/setup-ccache-action@v1
|
|
|
|
with:
|
|
|
|
update_packager_index: false
|
2021-10-03 16:09:09 +08:00
|
|
|
ccache_options: |
|
|
|
|
max_size=2G
|
2021-08-19 11:21:34 +08:00
|
|
|
|
2021-10-24 00:57:50 +08:00
|
|
|
- name: Install Qt
|
|
|
|
uses: jurplel/install-qt-action@v2
|
|
|
|
with:
|
|
|
|
version: ${{ matrix.qt_version }}
|
|
|
|
|
2021-08-19 11:21:34 +08:00
|
|
|
- name: Install libtorrent
|
|
|
|
run: |
|
2021-10-24 00:57:50 +08:00
|
|
|
git clone --branch v${{ matrix.libt_version }} --depth 1 https://github.com/arvidn/libtorrent.git
|
2021-08-19 11:21:34 +08:00
|
|
|
cd libtorrent
|
|
|
|
git submodule update --init --recursive
|
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
2021-11-06 11:11:47 +08:00
|
|
|
-Ddeprecated-functions=OFF
|
2021-08-19 11:21:34 +08:00
|
|
|
cmake --build build
|
|
|
|
sudo cmake --install build
|
|
|
|
|
2021-10-24 00:57:50 +08:00
|
|
|
- name: Build qBittorrent (Qt5)
|
|
|
|
if: ${{ startsWith(matrix.qt_version, 5) }}
|
|
|
|
run: |
|
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
2021-11-06 11:11:47 +08:00
|
|
|
-DCMAKE_INSTALL_PREFIX="/usr" \
|
2021-10-24 00:57:50 +08:00
|
|
|
-DQt5_DIR="$Qt5_DIR" \
|
|
|
|
-DVERBOSE_CONFIGURE=ON \
|
2021-11-06 11:11:47 +08:00
|
|
|
-D${{ matrix.qbt_gui }}
|
2021-10-24 00:57:50 +08:00
|
|
|
cmake --build build
|
2021-11-06 11:11:47 +08:00
|
|
|
DESTDIR="qbittorrent" cmake --install build
|
2021-10-24 00:57:50 +08:00
|
|
|
|
|
|
|
- name: Build qBittorrent (Qt6)
|
|
|
|
if: ${{ startsWith(matrix.qt_version, 6) }}
|
2021-08-19 11:21:34 +08:00
|
|
|
run: |
|
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
2021-11-06 11:11:47 +08:00
|
|
|
-DCMAKE_INSTALL_PREFIX="/usr" \
|
2021-10-24 00:57:50 +08:00
|
|
|
-DQT6=ON \
|
2021-11-06 11:11:47 +08:00
|
|
|
-DQt6_DIR="$Qt6_DIR" \
|
2021-08-19 11:21:34 +08:00
|
|
|
-DVERBOSE_CONFIGURE=ON \
|
2021-11-06 11:11:47 +08:00
|
|
|
-D${{ matrix.qbt_gui }}
|
2021-08-19 11:21:34 +08:00
|
|
|
cmake --build build
|
2021-11-06 11:11:47 +08:00
|
|
|
DESTDIR="qbittorrent" cmake --install build
|
|
|
|
|
|
|
|
- name: Prepare build artifacts
|
|
|
|
run: |
|
|
|
|
mkdir upload
|
|
|
|
mv qbittorrent upload
|
|
|
|
mkdir upload/cmake
|
|
|
|
cp build/compile_commands.json upload/cmake
|
|
|
|
mkdir upload/cmake/libtorrent
|
|
|
|
cp libtorrent/build/compile_commands.json upload/cmake/libtorrent
|
2021-08-19 11:21:34 +08:00
|
|
|
|
|
|
|
- name: Upload build artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2021-10-24 00:57:50 +08:00
|
|
|
name: qBittorrent-CI_ubuntu-20.04-x64_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
|
2021-11-06 11:11:47 +08:00
|
|
|
path: upload
|