-
Notifications
You must be signed in to change notification settings - Fork 32
251 lines (225 loc) · 8.04 KB
/
conan.yml
File metadata and controls
251 lines (225 loc) · 8.04 KB
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
name: Test conan packages
on:
# Runs for PRs that directly change conan code, and weekdays at 11:15pm UTC.
# Additional logic in the prepare job below makes it so scheduled builds only run
# on new commits.
schedule:
- cron: '0 10 * * *' # 10 AM UTC daily (6 AM EDT / 5 AM EST)
- cron: '0 10 * * 0' # 10 AM UTC every Sunday (weekly unconditional run)
workflow_dispatch:
pull_request:
paths:
- conanfile.py
- test_package/conanfile.py
- .github/workflows/conan.yml
jobs:
prepare:
if: github.repository_owner == 'viamrobotics'
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Get current git info
if: github.event_name == 'schedule'
id: git_info
run: |
echo "current_commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
echo "current_branch=$(git branch --show-current)" >> $GITHUB_OUTPUT
- name: Get last successful commit
if: github.event_name == 'schedule'
id: last_successful_commit
uses: tylermilner/last-successful-commit-hash-action@v1
with:
branch: main
workflow-id: conan.yml
github-token: ${{ github.token }}
- name: Cancel scheduled build with no new commits
uses: andymckay/cancel-action@0.2
if: |
github.event_name == 'schedule' &&
steps.git_info.outputs.current_commit == steps.last_successful_commit.outputs.commit-hash &&
github.event.schedule != '0 10 * * 0'
build_macos:
if: github.repository_owner == 'viamrobotics'
needs: [prepare]
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
platform: macosx_arm64
- target: x86_64-apple-darwin
platform: macosx_x86_64
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install dependencies
run: |
cmake --version
python --version
ninja --version
brew install buf
python -m pip install conan
- name: Create package
run: |
# `buf` tries to read a CLI config file that we don't actually use located at
# ~/.config/buf/config.yaml. We don't always have permission to access this
# directory in CI, so we set the `BUF_CONFIG_DIR` to some other value that we
# do have permissions for. See https://github.com/bufbuild/buf/issues/2698 for
# more details.
export BUF_CONFIG_DIR=$(mktemp -d)
conan profile detect
conan create . --build=missing -s compiler.cppstd=17
build_linux_ubuntu_jammy:
if: github.repository_owner == 'viamrobotics'
needs: [prepare]
runs-on: ${{ matrix.runs_on }}
container:
image: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-ubuntu-jammy-gnu
platform: linux_aarch64-ubuntu-jammy
image: ubuntu:22.04
runs_on: github-linux-arm64-8core
- target: x86_64-ubuntu-jammy-gnu
platform: linux_x86_64-ubuntu-jammy
image: ubuntu:22.04
runs_on: ubuntu-large
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt-get update
apt-get -y dist-upgrade
DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
autoconf \
automake \
build-essential \
ca-certificates \
curl \
doxygen \
g++ \
gdb \
gnupg \
gpg \
less \
ninja-build \
python3 \
python3-pip \
software-properties-common \
sudo \
wget \
sudo wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo gpg --dearmor - | sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
sudo echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
apt-get update
apt-get -y install cmake=3.25.2-0kitware1ubuntu22.04.1 cmake-data=3.25.2-0kitware1ubuntu22.04.1
pip install conan
- name: Create package
shell: bash
run: |
conan profile detect
conan create . --build=missing -s compiler.cppstd=14 -s:a compiler.cppstd=14
build_linux_debian:
if: github.repository_owner == 'viamrobotics'
needs: [prepare]
runs-on: ${{ matrix.runs_on }}
container:
image: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-debian-bullseye
platform: linux_aarch64-debian-bullseye
image: debian:bullseye
runs_on: github-linux-arm64-8core
- target: x86_64-debian-bullseye
platform: linux_x86_64-debian-bullseye
image: debian:bullseye
runs_on: ubuntu-large
- target: aarch64-debian-bookworm
platform: linux_aarch64-debian-bookworm
image: debian:bookworm
runs_on: github-linux-arm64-8core
- target: x86_64-debian-bookworm
platform: linux_x86_64-debian-bookworm
image: debian:bookworm
runs_on: ubuntu-large
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install dependencies
run: |
apt-get update
apt-get -y dist-upgrade
DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
autoconf \
build-essential \
ca-certificates \
cmake \
curl \
g++ \
gdb \
gnupg \
gpg \
less \
ninja-build \
python3 \
python3-pip \
python3-venv \
software-properties-common \
sudo \
wget
- name: Update CMake for bullseye
if: ${{ matrix.image == 'debian:bullseye' }}
run: |
apt-get install -y software-properties-common
apt-add-repository -y 'deb https://archive.debian.org/debian bullseye-backports main'
apt-get update
apt-get -y install cmake
apt-get -y --no-install-recommends install -t bullseye-backports cmake
# Note bullseye can use regular pip + conan no problem, but
# bookworm is a managed environment, so we use a venv in both because it is more
# trouble to bifurcate them.
- name: Install conan in venv and create package
shell: bash
run: |
python3 -m venv ./conan_venv
source ./conan_venv/bin/activate
pip install conan
conan profile detect
conan install -r conancenter --update \
--tool-requires=b2/5.3.1 --build=b2/5.3.1 -s compiler.cppstd=14 -s:a compiler.cppstd=14
conan create . --build=missing -s compiler.cppstd=14 -s:a compiler.cppstd=14
build_windows:
if: github.repository_owner == 'viamrobotics'
needs: [prepare]
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-windows
platform: windows_x86_64
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ needs.prepare.outputs.sha }}
- name: Install dependencies
run: choco install -y conan git
- name: Create package
shell: powershell
run: |
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
refreshenv
conan profile detect
conan create . --build=missing -o "&:shared=False"
env:
CONAN_USER_HOME: c:/cache
CONAN_USER_HOME_SHORT: c:/cache/conan_shortpaths