-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (115 loc) · 4.17 KB
/
cmake.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: CI
on:
push:
branches: [ master, main ]
pull_request:
branches: [ '**' ]
jobs:
build-manylinux:
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ubuntu-latest
container: ghcr.io/klebert-engineering/manylinux-cpp17-py${{ matrix.python-version }}:2023.1
env:
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- name: Install Conan
run: |
pip install conan
conan profile detect
- name: Configure
run: |
python3 -m venv venv && . ./venv/bin/activate
pip install -U setuptools wheel pip
mkdir build && cd build && cmake \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DCMAKE_BUILD_TYPE=Release -GNinja ..
- name: Build
working-directory: build
run: |
. ../venv/bin/activate
cmake --build .
mv bin/wheel bin/wheel-auditme
auditwheel repair bin/wheel-auditme/mapget*.whl -w bin/wheel
- name: Test
timeout-minutes: 30
working-directory: build
run: |
. ../venv/bin/activate
ctest -C Release --verbose --no-test=fail
- name: Deploy
uses: actions/upload-artifact@v2
with:
name: mapget-py${{ matrix.python-version }}-ubuntu-latest
path: build/bin/wheel/*.whl
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-2019]
python-version: ["3.8", "3.9", "3.10", "3.11"]
env:
SCCACHE_GHA_ENABLED: "true"
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install Conan
run: |
pip install conan
- run: python -m pip install setuptools wheel
- run: python -m pip install ninja
- run: mkdir build
- name: Build (macOS)
if: matrix.os == 'macos-latest' || matrix.os == 'macos-10.15'
working-directory: build
run: |
python -m pip install delocate
export MACOSX_DEPLOYMENT_TARGET=10.15
cmake -DPython3_ROOT_DIR=$pythonLocation \
-DPython3_FIND_FRAMEWORK=LAST \
-DCMAKE_BUILD_TYPE=Release \
-DHTTPLIB_USE_BROTLI_IF_AVAILABLE=OFF \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-GNinja ..
cmake --build .
mv bin/wheel bin/wheel-auditme # Same as on Linux
./_deps/python-cmake-wheel-src/repair-wheel-macos.bash \
"$(pwd)"/bin/wheel-auditme/mapget*.whl \
"$(pwd)"/bin/wheel mapget
- name: Add msbuild to PATH (Windows)
if: matrix.os == 'windows-latest' || matrix.os == 'windows-2019'
uses: microsoft/setup-msbuild@v1.0.1 conan profile detect
- name: Build (Windows)
if: matrix.os == 'windows-latest' || matrix.os == 'windows-2019'
working-directory: build
env:
CMAKE_GENERATOR: "Visual Studio 16 2019"
run: |
echo "cmake -DPython3_ROOT_DIR=$env:pythonLocation"
cmake "-DPython3_ROOT_DIR=$env:pythonLocation" -DPython3_FIND_REGISTRY=LAST -DHTTPLIB_USE_ZLIB_IF_AVAILABLE=OFF -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_DEST_WIN }}\scripts\buildsystems\vcpkg.cmake -GNinja ..
cmake --build . --config Release
- name: Deploy
uses: actions/upload-artifact@v2
with:
name: mapget-py${{ matrix.python-version }}-${{ matrix.os }}
path: build/bin/wheel/*.whl
- name: Test
timeout-minutes: 30
working-directory: build
run: |
ctest -C Release --verbose --no-test=fail