2021-08-19 06:21:34 +03:00
|
|
|
name: CI - macOS
|
2022-02-25 08:34:28 +03:00
|
|
|
|
2021-08-19 06:21:34 +03:00
|
|
|
on: [pull_request, push]
|
|
|
|
|
2022-02-25 08:34:28 +03:00
|
|
|
concurrency:
|
2022-03-02 08:26:13 +03:00
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
2022-02-25 08:34:28 +03:00
|
|
|
cancel-in-progress: ${{ github.head_ref != '' }}
|
|
|
|
|
2021-08-19 06:21:34 +03:00
|
|
|
jobs:
|
|
|
|
ci:
|
|
|
|
name: Build
|
2021-10-22 07:16:11 +03:00
|
|
|
runs-on: macos-latest
|
2021-08-19 06:21:34 +03:00
|
|
|
|
|
|
|
strategy:
|
2021-10-23 19:57:50 +03:00
|
|
|
fail-fast: false
|
2021-08-19 06:21:34 +03:00
|
|
|
matrix:
|
2022-07-19 06:13:47 +03:00
|
|
|
libt_version: ["2.0.7", "1.2.17"]
|
2021-08-19 06:21:34 +03:00
|
|
|
qbt_gui: ["GUI=ON", "GUI=OFF"]
|
2022-07-10 08:20:27 +03:00
|
|
|
qt_version: ["5.15.2", "6.2.0"]
|
2021-10-23 19:57:50 +03:00
|
|
|
exclude:
|
2022-07-19 06:13:47 +03:00
|
|
|
- libt_version: "1.2.17"
|
2022-07-10 08:20:27 +03:00
|
|
|
qt_version: "6.2.0"
|
2021-08-19 06:21:34 +03:00
|
|
|
|
|
|
|
env:
|
2022-02-26 09:17:38 +03:00
|
|
|
boost_path: "${{ github.workspace }}/../boost"
|
2021-08-19 06:21:34 +03:00
|
|
|
openssl_root: /usr/local/opt/openssl@1.1
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2022-03-02 22:39:35 +03:00
|
|
|
uses: actions/checkout@v3
|
2021-08-19 06:21:34 +03:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
brew update > /dev/null
|
|
|
|
brew install \
|
|
|
|
cmake ninja \
|
2022-02-26 09:17:38 +03:00
|
|
|
openssl@1.1 zlib
|
2021-08-19 06:21:34 +03:00
|
|
|
|
2021-09-23 07:38:52 +03:00
|
|
|
- name: Setup ccache
|
|
|
|
uses: Chocobo1/setup-ccache-action@v1
|
|
|
|
with:
|
|
|
|
update_packager_index: false
|
|
|
|
|
2022-02-26 09:17:38 +03:00
|
|
|
- name: Install boost
|
|
|
|
run: |
|
|
|
|
curl \
|
|
|
|
-L \
|
|
|
|
-o "${{ runner.temp }}/boost.tar.bz2" \
|
2022-08-11 10:20:25 +03:00
|
|
|
"https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.bz2"
|
2022-02-26 09:17:38 +03:00
|
|
|
tar -xf "${{ runner.temp }}/boost.tar.bz2" -C "${{ github.workspace }}/.."
|
|
|
|
mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
|
|
|
|
|
2021-10-23 19:57:50 +03:00
|
|
|
- name: Install Qt
|
2022-08-18 06:44:40 +03:00
|
|
|
uses: jurplel/install-qt-action@v3
|
2021-10-23 19:57:50 +03:00
|
|
|
with:
|
|
|
|
version: ${{ matrix.qt_version }}
|
|
|
|
|
2021-08-19 06:21:34 +03:00
|
|
|
- name: Install libtorrent
|
|
|
|
run: |
|
2021-11-17 10:53:27 +03:00
|
|
|
git clone \
|
|
|
|
--branch v${{ matrix.libt_version }} \
|
|
|
|
--depth 1 \
|
|
|
|
--recurse-submodules \
|
|
|
|
https://github.com/arvidn/libtorrent.git
|
2021-08-19 06:21:34 +03:00
|
|
|
cd libtorrent
|
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_CXX_STANDARD=17 \
|
2021-11-06 06:11:47 +03:00
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
2022-02-26 09:17:38 +03:00
|
|
|
-DBOOST_ROOT="${{ env.boost_path }}" \
|
2021-08-19 06:21:34 +03:00
|
|
|
-Ddeprecated-functions=OFF \
|
|
|
|
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}"
|
|
|
|
cmake --build build
|
|
|
|
sudo cmake --install build
|
|
|
|
|
2021-10-23 19:57:50 +03:00
|
|
|
- name: Build qBittorrent (Qt5)
|
|
|
|
if: ${{ startsWith(matrix.qt_version, 5) }}
|
2021-08-19 06:21:34 +03:00
|
|
|
run: |
|
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
2021-11-06 06:11:47 +03:00
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
2022-02-26 09:17:38 +03:00
|
|
|
-DBOOST_ROOT="${{ env.boost_path }}" \
|
2021-10-23 19:57:50 +03:00
|
|
|
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \
|
2022-07-10 08:20:27 +03:00
|
|
|
-DTESTING=ON \
|
2021-08-19 06:21:34 +03:00
|
|
|
-DVERBOSE_CONFIGURE=ON \
|
2021-10-23 19:57:50 +03:00
|
|
|
-D${{ matrix.qbt_gui }}
|
2022-05-29 01:08:51 +03:00
|
|
|
cmake --build build --target qbt_update_translations
|
2021-10-23 19:57:50 +03:00
|
|
|
cmake --build build
|
2022-07-10 08:20:27 +03:00
|
|
|
cmake --build build --target check
|
2021-10-23 19:57:50 +03:00
|
|
|
|
|
|
|
- name: Build qBittorrent (Qt6)
|
|
|
|
if: ${{ startsWith(matrix.qt_version, 6) }}
|
|
|
|
run: |
|
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
2021-11-06 06:11:47 +03:00
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
2022-02-26 09:17:38 +03:00
|
|
|
-DBOOST_ROOT="${{ env.boost_path }}" \
|
2021-10-23 19:57:50 +03:00
|
|
|
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \
|
|
|
|
-DQT6=ON \
|
2022-07-10 08:20:27 +03:00
|
|
|
-DTESTING=ON \
|
2021-10-23 19:57:50 +03:00
|
|
|
-DVERBOSE_CONFIGURE=ON \
|
|
|
|
-D${{ matrix.qbt_gui }}
|
2022-05-29 01:08:51 +03:00
|
|
|
cmake --build build --target qbt_update_translations
|
2021-08-19 06:21:34 +03:00
|
|
|
cmake --build build
|
2022-07-10 08:20:27 +03:00
|
|
|
cmake --build build --target check
|
2021-08-19 06:21:34 +03:00
|
|
|
|
2021-11-06 06:11:47 +03:00
|
|
|
- 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
|
|
|
|
|
2021-08-19 06:21:34 +03:00
|
|
|
- name: Upload build artifacts
|
2022-03-05 02:13:36 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-08-19 06:21:34 +03:00
|
|
|
with:
|
2022-02-27 10:35:41 +03:00
|
|
|
name: build-info_macOS_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
|
2021-11-06 06:11:47 +03:00
|
|
|
path: upload
|