qBittorrent/.github/workflows/ci_ubuntu.yaml

112 lines
3.3 KiB
YAML
Raw Normal View History

name: CI - Ubuntu
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: ${{ github.head_ref != '' }}
jobs:
ci:
name: Build
runs-on: ubuntu-20.04
strategy:
2021-10-24 00:57:50 +08:00
fail-fast: false
matrix:
libt_version: ["2.0.6", "1.2.16"]
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.16"
2021-10-24 00:57:50 +08:00
qt_version: "6.2.0"
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt update
sudo apt install \
build-essential cmake ninja-build pkg-config \
2021-10-24 00:57:50 +08:00
libboost-dev libssl-dev zlib1g-dev
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
with:
update_packager_index: false
ccache_options: |
max_size=2G
2021-10-24 00:57:50 +08:00
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ matrix.qt_version }}
- name: Install libtorrent
run: |
2021-11-17 15:53:27 +08:00
git clone \
--branch v${{ matrix.libt_version }} \
--depth 1 \
--recurse-submodules \
https://github.com/arvidn/libtorrent.git
cd libtorrent
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-Ddeprecated-functions=OFF
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 \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DTESTING=ON \
2021-10-24 00:57:50 +08:00
-DVERBOSE_CONFIGURE=ON \
-D${{ matrix.qbt_gui }}
cmake --build build --target qbt_update_translations
2021-10-24 00:57:50 +08:00
cmake --build build
cmake --build build --target check
DESTDIR="qbittorrent" cmake --install build
2021-10-24 00:57:50 +08:00
- name: Build qBittorrent (Qt6)
if: ${{ startsWith(matrix.qt_version, 6) }}
run: |
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_INSTALL_PREFIX="/usr" \
2021-10-24 00:57:50 +08:00
-DQT6=ON \
-DTESTING=ON \
-DVERBOSE_CONFIGURE=ON \
-D${{ matrix.qbt_gui }}
cmake --build build --target qbt_update_translations
cmake --build build
cmake --build build --target check
DESTDIR="qbittorrent" cmake --install build
- name: Prepare build artifacts
run: |
mkdir upload
mkdir upload/cmake
cp build/compile_commands.json upload/cmake
mkdir upload/cmake/libtorrent
cp libtorrent/build/compile_commands.json upload/cmake/libtorrent
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-info_ubuntu-20.04-x64_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
path: upload