Sync translations from Transifex and run lupdate
[qBittorrent.git] / .github / workflows / ci_ubuntu.yaml
blob9a65975543ef00c2bf87915191c3505b2db4abb0
1 name: CI - Ubuntu
2 on: [pull_request, push]
4 jobs:
5   ci:
6     name: Build
7     runs-on: ubuntu-20.04
9     strategy:
10       matrix:
11         libt_version: ["v2.0.4", "v1.2.14"]
12         qbt_gui: ["GUI=ON", "GUI=OFF"]
13       fail-fast: false
15     steps:
16       - name: Checkout repository
17         uses: actions/checkout@v2
19       - name: Setup ccache
20         uses: hendrikmuhs/ccache-action@v1
21         with:
22           key: ${{ runner.os }}
24       - name: Install dependencies
25         run: |
26           sudo apt update
27           sudo apt install \
28             build-essential cmake git ninja-build pkg-config \
29             libssl-dev libgeoip-dev zlib1g-dev \
30             libboost-dev libboost-chrono-dev libboost-random-dev libboost-system-dev
31         # sudo apt install libqt5svg5-dev qtbase5-dev qttools5-dev # the Qt version in the standard repositories is too old...
33       # this will be installed under /opt/qt515. CMake will still find it automatically without additional hints
34       # to speed up the process, only the required components are installed rather than the full qt515-meta-full metapackage
35       - name: Install Qt
36         run: |
37           sudo add-apt-repository ppa:beineri/opt-qt-5.15.2-focal
38           sudo apt install \
39             qt515base qt515svg qt515tools
41       - name: Install libtorrent
42         run: |
43           git clone --branch ${{ matrix.libt_version }} --depth 1 https://github.com/arvidn/libtorrent.git
44           cd libtorrent
45           git submodule update --init --recursive
46           export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
47           cmake \
48             -B build \
49             -G "Ninja" \
50             -DCMAKE_BUILD_TYPE=RelWithDebInfo \
51             -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
52             -Ddeprecated-functions=OFF \
53             --graphviz=cmake-build-dir/target_graph.dot
54           cmake --build build
55           sudo cmake --install build
57       - name: Build qBittorrent
58         run: |
59           export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
60           cmake \
61             -B build \
62             -G "Ninja" \
63             -DCMAKE_BUILD_TYPE=RelWithDebInfo \
64             -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
65             -D${{ matrix.qbt_gui }} \
66             -DVERBOSE_CONFIGURE=ON \
67             --graphviz=build/target_graph.dot
68           cmake --build build
70       - name: Install qBittorrent
71         run: sudo cmake --install build
73       - name: Upload build artifacts
74         uses: actions/upload-artifact@v2
75         with:
76           name: qBittorrent-CI_ubuntu-20.04-x64_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}
77           path: |
78             build/compile_commands.json
79             build/install_manifest.txt
80             build/target_graph.dot
81             build/qbittorrent
82             build/qbittorrent-nox
83             libtorrent/cmake-build-dir/compile_commands.json
84             libtorrent/cmake-build-dir/target_graph.dot