Skip to content

Commit 3e36a24

Browse files
authored
Merge pull request #265 from offa/backport/ci_fixes
Backport CI fixes / Remove Conan CI build
2 parents 3f5c457 + 6f40aa8 commit 3e36a24

File tree

6 files changed

+21
-109
lines changed

6 files changed

+21
-109
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ jobs:
3030
- name: Install Boost
3131
if: ${{ matrix.boost == true }}
3232
run: |
33-
add-apt-repository ppa:nicola-onorata/toolchain
33+
add-apt-repository ppa:mhier/libboost-latest
3434
apt-get update
35-
apt-get install -y boost1.81
35+
apt-get install -y boost1.83
3636
- name: Build
3737
run: script/ci_build.sh -DINFLUXCXX_WITH_BOOST=${{ matrix.boost }}
3838
- name: Check deployment as cmake subdirectory
@@ -43,32 +43,6 @@ jobs:
4343
run: script/ci_testdeploy.sh -DINFLUXCXX_AS_SUBDIR=OFF
4444

4545

46-
build_conan:
47-
runs-on: ubuntu-latest
48-
strategy:
49-
matrix:
50-
boost:
51-
- "True"
52-
- "False"
53-
name: "conan (Boost: ${{ matrix.boost }})"
54-
steps:
55-
- uses: actions/checkout@main
56-
- name: Cache Conan Packages
57-
uses: actions/cache@main
58-
with:
59-
path: ~/.conan2/p/
60-
key: conan-${{ runner.os }}-${{ matrix.compiler }}-boost_${{ matrix.boost }}-${{ hashFiles('conanfile.py') }}
61-
- name: Setup
62-
run: |
63-
pip install -U conan
64-
sudo apt-get install -y libcurl4-openssl-dev
65-
echo "~/.local/bin" >> $GITHUB_PATH
66-
- name: Setup Conan
67-
run: conan profile detect
68-
- name: Build
69-
run: conan create -o "influxdb-cxx/*":boost=${{ matrix.boost }} -o "influxdb-cxx/*":tests=True --build=missing .
70-
71-
7246
build_windows:
7347
runs-on: windows-latest
7448
strategy:

.github/workflows/codeql.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ jobs:
1616
- name: Install dependencies
1717
run: |
1818
script/ci_setup.sh
19-
apt-get install -y libboost-system-dev
19+
add-apt-repository ppa:mhier/libboost-latest
20+
apt-get update
21+
apt-get install -y boost1.83
2022
- name: CodeQL Initialization
2123
uses: github/codeql-action/init@v2
2224
with:

.github/workflows/systemtest.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ jobs:
3636
- name: Setup
3737
run: |
3838
script/ci_setup.sh
39-
apt-get install -y libboost-system-dev
39+
add-apt-repository ppa:mhier/libboost-latest
40+
apt-get update
41+
apt-get install -y boost1.83
4042
- name: Build
4143
run: |
4244
cmake --preset conan-release

conanfile.py

Lines changed: 7 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,25 @@
1-
import re
2-
import os
31
from conan import ConanFile
4-
from conan.tools.files import load, copy, collect_libs
5-
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps
6-
from conan.errors import ConanInvalidConfiguration
7-
82

93
class InfluxdbCxxConan(ConanFile):
10-
name = "influxdb-cxx"
11-
license = "MIT"
12-
author = "offa <offa@github>"
13-
url = "https://github.com/offa/influxdb-cxx"
14-
hompage = url
15-
description = "InfluxDB C++ client library."
16-
topics = ("influxdb", "influxdb-client")
174
settings = "os", "compiler", "build_type", "arch"
5+
generators = "CMakeDeps", "CMakeToolchain"
6+
187
options = {
19-
"shared": [True, False],
208
"tests": [True, False],
219
"system": [True, False],
2210
"boost": [True, False]
2311
}
2412
default_options = {
25-
"shared": False,
26-
"tests": False,
13+
"tests": True,
2714
"system": False,
2815
"boost": True,
2916
"boost/*:shared": True,
3017
}
31-
exports = ["LICENSE"]
32-
exports_sources = ("CMakeLists.txt", "src/*", "include/*", "test/*",
33-
"cmake/*", "3rd-party/*")
34-
35-
def set_version(self):
36-
cmake_lists_content = load(
37-
self, os.path.join(self.recipe_folder, "CMakeLists.txt"))
38-
project_match = re.search(r'project\s*\((.+?)\)', cmake_lists_content,
39-
re.DOTALL)
40-
41-
if not project_match:
42-
raise ConanInvalidConfiguration(
43-
"No valid project() statement found in CMakeLists.txt")
44-
45-
project_params = project_match.group(1).split()
46-
version_string = project_params[project_params.index("VERSION") + 1]
47-
48-
if not re.search(r'\d+\.\d+\.\d+(?:\.\d)?', version_string):
49-
raise ConanInvalidConfiguration(
50-
"No valid version found in CMakeLists.txt")
51-
52-
self.version = version_string
53-
self.output.info(
54-
f"Project version from CMakeLists.txt: '{self.version}'")
5518

5619
def requirements(self):
57-
self.requires("cpr/1.10.0")
20+
self.requires("cpr/1.10.5")
5821
if not self.options.system and self.options.boost:
59-
self.requires("boost/1.81.0")
22+
self.requires("boost/1.85.0")
6023
if self.options.tests:
61-
self.requires("catch2/3.3.1")
62-
self.requires("trompeloeil/43")
63-
64-
def generate(self):
65-
tc = CMakeToolchain(self)
66-
tc.cache_variables["INFLUXCXX_TESTING"] = self.options.tests
67-
tc.cache_variables["INFLUXCXX_WITH_BOOST"] = self.options.boost
68-
tc.generate()
69-
70-
deps = CMakeDeps(self)
71-
deps.generate()
72-
73-
def build(self):
74-
cmake = self._configure_cmake()
75-
cmake.build()
76-
77-
if self.options.tests:
78-
cmake.test()
79-
80-
def package(self):
81-
cmake = self._configure_cmake()
82-
cmake.install()
83-
copy(self, pattern="LICENSE", dst="licenses", src=self.source_folder)
84-
85-
def package_info(self):
86-
self.cpp_info.libs = collect_libs(self)
87-
self.cpp_info.set_property("cmake_file_name", "InfluxDB")
88-
self.cpp_info.set_property("cmake_target_name", "InfluxData::InfluxDB")
89-
90-
def _configure_cmake(self):
91-
cmake = CMake(self)
92-
cmake.configure()
93-
return cmake
24+
self.requires("catch2/3.7.1")
25+
self.requires("trompeloeil/48")

script/ci_setup.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
set -ex
44

5+
export DEBIAN_FRONTEND=noninteractive
6+
export PATH=$HOME/.local/bin:$PATH
57
apt-get update
6-
apt-get install -y python3-pip libssl-dev libcurl4-openssl-dev
7-
pip3 install -U conan
8+
apt-get install -y pipx
9+
pipx install conan
10+
conan profile detect
811

912
mkdir -p build && cd build
1013

11-
conan profile detect
12-
1314
if [[ "${CXX}" == clang* ]]
1415
then
1516
STDLIB_ENV="CXXFLAGS=\"-stdlib=libc++\""

script/ci_testdeploy.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -ex
55
PID=$$
66
BASEPATH=/tmp/influx-test-${PID}
77
BUILD_TYPE="Release"
8+
export PATH=$HOME/.local/bin:$PATH
89

910
echo "perform deployment test in ${BASEPATH}"
1011
mkdir -p ${BASEPATH}/influxdb-cxx

0 commit comments

Comments
 (0)