2021-08-19 11:21:34 +08:00
|
|
|
name: CI - macOS
|
2022-02-25 13:34:28 +08:00
|
|
|
|
2021-08-19 11:21:34 +08:00
|
|
|
on: [pull_request, push]
|
|
|
|
|
2022-02-25 13:34:28 +08:00
|
|
|
concurrency:
|
2022-03-02 13:26:13 +08:00
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
2022-02-25 13:34:28 +08:00
|
|
|
cancel-in-progress: ${{ github.head_ref != '' }}
|
|
|
|
|
2021-08-19 11:21:34 +08:00
|
|
|
jobs:
|
|
|
|
ci:
|
|
|
|
name: Build
|
2021-10-22 12:16:11 +08:00
|
|
|
runs-on: macos-latest
|
2021-08-19 11:21:34 +08:00
|
|
|
|
|
|
|
strategy:
|
2021-10-24 00:57:50 +08:00
|
|
|
fail-fast: false
|
2021-08-19 11:21:34 +08:00
|
|
|
matrix:
|
2021-12-09 12:32:52 +08:00
|
|
|
libt_version: ["2.0.5", "1.2.15"]
|
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:
|
2021-12-09 12:32:52 +08:00
|
|
|
- libt_version: "1.2.15"
|
2021-10-24 00:57:50 +08:00
|
|
|
qt_version: "6.2.0"
|
2021-08-19 11:21:34 +08:00
|
|
|
|
|
|
|
env:
|
2022-02-26 14:17:38 +08:00
|
|
|
boost_path: "${{ github.workspace }}/../boost"
|
2021-08-19 11:21:34 +08:00
|
|
|
openssl_root: /usr/local/opt/openssl@1.1
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2022-03-03 03:39:35 +08:00
|
|
|
uses: actions/checkout@v3
|
2021-08-19 11:21:34 +08:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
brew update > /dev/null
|
|
|
|
brew install \
|
|
|
|
cmake ninja \
|
2022-02-26 14:17:38 +08:00
|
|
|
openssl@1.1 zlib
|
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
|
|
|
|
|
2022-02-26 14:17:38 +08:00
|
|
|
- name: Install boost
|
|
|
|
run: |
|
|
|
|
curl \
|
|
|
|
-L \
|
|
|
|
-o "${{ runner.temp }}/boost.tar.bz2" \
|
|
|
|
"https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2"
|
|
|
|
tar -xf "${{ runner.temp }}/boost.tar.bz2" -C "${{ github.workspace }}/.."
|
|
|
|
mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
|
|
|
|
|
2021-10-24 00:57:50 +08:00
|
|
|
- name: Install Qt
|
|
|
|
uses: jurplel/install-qt-action@v2
|
|
|
|
with:
|
2022-03-29 11:08:50 +08:00
|
|
|
setup-python: false
|
2021-10-24 00:57:50 +08:00
|
|
|
version: ${{ matrix.qt_version }}
|
|
|
|
|
2021-08-19 11:21:34 +08:00
|
|
|
- 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
|
2021-08-19 11:21:34 +08:00
|
|
|
cd libtorrent
|
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_CXX_STANDARD=17 \
|
2021-11-06 11:11:47 +08:00
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
2022-02-26 14:17:38 +08:00
|
|
|
-DBOOST_ROOT="${{ env.boost_path }}" \
|
2021-08-19 11:21:34 +08:00
|
|
|
-Ddeprecated-functions=OFF \
|
|
|
|
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}"
|
|
|
|
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) }}
|
2021-08-19 11:21:34 +08:00
|
|
|
run: |
|
2021-12-07 12:17:15 +08:00
|
|
|
lupdate -extensions c,cpp,h,hpp,ui ./
|
2021-08-19 11:21:34 +08:00
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
2021-11-06 11:11:47 +08:00
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
2022-02-26 14:17:38 +08:00
|
|
|
-DBOOST_ROOT="${{ env.boost_path }}" \
|
2021-10-24 00:57:50 +08:00
|
|
|
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \
|
2021-08-19 11:21:34 +08:00
|
|
|
-DVERBOSE_CONFIGURE=ON \
|
2021-10-24 00:57:50 +08:00
|
|
|
-D${{ matrix.qbt_gui }}
|
|
|
|
cmake --build build
|
|
|
|
|
|
|
|
- name: Build qBittorrent (Qt6)
|
|
|
|
if: ${{ startsWith(matrix.qt_version, 6) }}
|
|
|
|
run: |
|
2021-12-07 12:17:15 +08:00
|
|
|
lupdate -extensions c,cpp,h,hpp,ui ./
|
2021-10-24 00:57:50 +08:00
|
|
|
cmake \
|
|
|
|
-B build \
|
|
|
|
-G "Ninja" \
|
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
2021-11-06 11:11:47 +08:00
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
2022-02-26 14:17:38 +08:00
|
|
|
-DBOOST_ROOT="${{ env.boost_path }}" \
|
2021-10-24 00:57:50 +08:00
|
|
|
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \
|
|
|
|
-DQT6=ON \
|
|
|
|
-DVERBOSE_CONFIGURE=ON \
|
|
|
|
-D${{ matrix.qbt_gui }}
|
2021-08-19 11:21:34 +08:00
|
|
|
cmake --build build
|
|
|
|
|
2021-11-06 11:11:47 +08: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 11:21:34 +08:00
|
|
|
- name: Upload build artifacts
|
2022-03-05 07:13:36 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-08-19 11:21:34 +08:00
|
|
|
with:
|
2022-02-27 15:35:41 +08:00
|
|
|
name: build-info_macOS_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
|
2021-11-06 11:11:47 +08:00
|
|
|
path: upload
|