Skip to content

Commit 6f1720e

Browse files
committed
Merge branch 'main' of github.com:viamrobotics/viam-cpp-sdk
2 parents be04812 + 331fd12 commit 6f1720e

File tree

1 file changed

+40
-10
lines changed

1 file changed

+40
-10
lines changed

.github/workflows/conan.yml

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,33 @@
11
name: Test conan packages
22

33
on:
4+
# Run weekdays at 11:15pm UTC, and specify below to only run if there's been new commits
5+
schedule:
6+
- cron: "15 11 * * 1-5"
47
workflow_dispatch:
58

69
jobs:
10+
prepare:
11+
if: github.repository_owner == 'viamrobotics'
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v4
16+
17+
- name: Get new commit count
18+
id: new_commit_count
19+
shell: bash
20+
run: echo "commit_count=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_OUTPUT
21+
22+
- name: Cancelling scheduled build with no new commits
23+
uses: andymckay/[email protected]
24+
if: |
25+
steps.new_commit_count.outputs.commit_count == '0' &&
26+
github.event_name == 'schedule'
27+
728
build_macos:
8-
# if: github.repository_owner == 'viamrobotics'
29+
if: github.repository_owner == 'viamrobotics'
30+
needs: [prepare]
931
runs-on: macos-latest
1032
strategy:
1133
fail-fast: false
@@ -25,7 +47,7 @@ jobs:
2547
brew install python ninja buf
2648
python -m pip install conan
2749
28-
- name: Build
50+
- name: Create package
2951
run: |
3052
# `buf` tries to read a CLI config file that we don't actually use located at
3153
# ~/.config/buf/config.yaml. We don't always have permission to access this
@@ -34,10 +56,11 @@ jobs:
3456
# more details.
3557
export BUF_CONFIG_DIR=$(mktemp -d)
3658
conan profile detect
37-
conan create . --build=missing
59+
conan create . --build=missing -s compiler.cppstd=17
3860
3961
build_linux_ubuntu_jammy:
40-
# if: github.repository_owner == 'viamrobotics'
62+
if: github.repository_owner == 'viamrobotics'
63+
needs: [prepare]
4164
runs-on: ${{ matrix.runs_on }}
4265
container:
4366
image: ${{ matrix.image }}
@@ -91,10 +114,11 @@ jobs:
91114
shell: bash
92115
run: |
93116
conan profile detect
94-
conan create . --build=missing
117+
conan create . --build=missing -s compiler.cppstd=14
95118
96119
build_linux_debian:
97-
# if: github.repository_owner == 'viamrobotics'
120+
if: github.repository_owner == 'viamrobotics'
121+
needs: [prepare]
98122
runs-on: ${{ matrix.runs_on }}
99123
container:
100124
image: ${{ matrix.image }}
@@ -140,11 +164,10 @@ jobs:
140164
ninja-build \
141165
python3 \
142166
python3-pip \
167+
python3-venv \
143168
software-properties-common \
144169
sudo \
145170
wget
146-
147-
pip install conan
148171
149172
- name: Update CMake for bullseye
150173
if: ${{ matrix.image == 'debian:bullseye' }}
@@ -156,8 +179,15 @@ jobs:
156179
157180
apt-get -y --no-install-recommends install -t bullseye-backports cmake
158181
159-
- name: Create package
182+
# Note bullseye can use regular pip + conan no problem, but
183+
# bookworm is a managed environment, so we use a venv in both because it is more
184+
# trouble to bifurcate them.
185+
- name: Install conan in venv and create package
160186
shell: bash
161187
run: |
188+
python3 -m venv ./conan_venv
189+
source ./conan_venv/bin/activate
190+
191+
pip install conan
162192
conan profile detect
163-
conan create . --build=missing
193+
conan create . --build=missing -s compiler.cppstd=14

0 commit comments

Comments
 (0)