forked from novatel/novatel_edie
-
Notifications
You must be signed in to change notification settings - Fork 0
157 lines (133 loc) · 4.48 KB
/
build.yml
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Build
on:
push:
paths-ignore:
- '**.md'
- 'LICENSE'
- '.gitignore'
- 'resources/**'
pull_request:
paths-ignore:
- '**.md'
- 'LICENSE'
- '.gitignore'
- 'resources/**'
workflow_dispatch:
jobs:
python:
name: Python - ${{ matrix.platform[0] }} - ${{ matrix.platform[2] }}
runs-on: ${{ matrix.platform[1] }}
strategy:
fail-fast: false
matrix:
platform:
- [Linux, ubuntu-latest, x86_64]
- [Linux, ubuntu-latest, i686]
- [Windows, windows-latest, AMD64]
- [Windows, windows-latest, x86]
- [Windows, windows-latest, ARM64]
- [MacOS, macos-latest, x86_64]
- [MacOS, macos-latest, arm64]
# aarch64 with QEMU works, but builds 10x slower than the rest
# - [Linux, ubuntu-latest, aarch64]
# spdlog fails to build with the correct architecture on universal2
# - [MacOS, macos-latest, universal2]
# ppc64le is too obscure and slow to build due to emulation
# - [Linux, ubuntu-latest, ppc64le]
# s390x is too obscure is not compatible due to being big-endian
# - [Linux, ubuntu-latest, s390x]
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install cibuildwheel
run: python -m pip install --upgrade cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS: ${{ matrix.platform[2] }}
CIBW_BUILD: cp38* cp312*
CIBW_SKIP: "*-musllinux*"
- name: Inspect
run: ls wheelhouse/
conan:
name: Conan - ${{ matrix.platform[0] }} - ${{ matrix.platform[2] }}
runs-on: ${{ matrix.platform[1] }}
strategy:
fail-fast: false
matrix:
platform:
- [Linux, ubuntu-latest, gcc]
- [Linux, ubuntu-latest, clang]
- [Windows, windows-latest, msvc]
- [MacOS, macos-latest, apple-clang]
steps:
- uses: actions/checkout@v3
- name: Install Clang
if: matrix.platform[2] == 'clang'
uses: KyleMayes/install-llvm-action@v1
with:
version: "17.0"
- name: Set env vars for Clang
if: matrix.platform[2] == 'clang'
run: echo "CC=clang" >> $GITHUB_ENV && echo "CXX=clang++" >> $GITHUB_ENV
- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
- name: Create default profile
run: conan profile detect
- name: Set compiler.cppstd to 17
shell: bash
run: |
if [[ "$RUNNER_OS" == "macOS" ]]; then sed_i='sed -i ""'; else sed_i='sed -i'; fi
$sed_i 's/compiler.cppstd=.*/compiler.cppstd=17/' "$(conan config home)/profiles/default"
- name: Build Conan package - static
run: conan create . --build missing
- name: Build Conan package - shared
run: conan create . --build missing -o "*/*:shared=True"
standalone:
name: CMake - ${{ matrix.platform[0] }} - ${{ matrix.platform[2] }}
runs-on: ${{ matrix.platform[1] }}
strategy:
fail-fast: false
matrix:
platform:
- [Linux, ubuntu-latest, gcc]
- [Linux, ubuntu-latest, clang]
- [Windows, windows-latest, msvc]
- [MacOS, macos-latest, apple-clang]
steps:
- uses: actions/checkout@v3
- name: Install Clang
if: matrix.platform[2] == 'clang'
uses: KyleMayes/install-llvm-action@v1
with:
version: "17.0"
- name: Set env vars for Clang
if: matrix.platform[2] == 'clang'
run: echo "CC=clang" >> $GITHUB_ENV && echo "CXX=clang++" >> $GITHUB_ENV
- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.27"
- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
- name: Configure
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build --parallel
- name: Test
run: ctest --test-dir build --build-config Release
- name: Install
run: cmake --install build --prefix install
- name: Inspect prep
if: matrix.platform[0] == 'MacOS'
run: brew install tree
- name: Inspect
run: tree install/