Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RS-563: Migration to Conan v2 #83

Merged
merged 50 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
b90a8df
start migration to conan2
victor1234 Jan 12, 2025
289dbb1
fix conan package
victor1234 Jan 12, 2025
6583aa1
Reformat
victor1234 Jan 12, 2025
5518809
change conan version to 2, fix CI
victor1234 Jan 12, 2025
aa72318
fix conan version
victor1234 Jan 12, 2025
0867ae9
Fix CI
victor1234 Jan 14, 2025
4fc578f
Fix CI
victor1234 Jan 14, 2025
cff4606
Fix CI
victor1234 Jan 14, 2025
3569831
Fix CI
victor1234 Jan 14, 2025
d9355ca
Fix CI
victor1234 Jan 14, 2025
73156f3
Fix CI
victor1234 Jan 14, 2025
ece48a6
Fix cmake preset name
victor1234 Jan 18, 2025
3bd49b3
Fix bash command
victor1234 Jan 18, 2025
f0234a0
Add install conan action
victor1234 Jan 18, 2025
25b6925
Add action file
victor1234 Jan 18, 2025
7152bcb
Add shell name
victor1234 Jan 18, 2025
2a24343
Change build-package action
victor1234 Jan 18, 2025
033af4b
Fix unit test clone
victor1234 Jan 18, 2025
48d8201
Add install
victor1234 Jan 18, 2025
4d5764d
Fix install
victor1234 Jan 18, 2025
60ea489
Fix install
victor1234 Jan 18, 2025
c5b9eee
Fix install
victor1234 Jan 18, 2025
d78e52e
Fix install
victor1234 Jan 18, 2025
5a70c78
Fix build
victor1234 Jan 18, 2025
89a7a95
Fix build
victor1234 Jan 18, 2025
08d3748
Fix conan install
victor1234 Jan 18, 2025
ffc5ed6
Add REDUCT_CPP_USE_STD_CHRONO
victor1234 Jan 19, 2025
e385f2f
Set c++ standart to 20
victor1234 Jan 19, 2025
c32141c
Add date
victor1234 Jan 19, 2025
d191986
Add sudo
victor1234 Jan 19, 2025
930a221
Remove install step from main ci
victor1234 Jan 19, 2025
16a67e1
Add show preset
victor1234 Jan 19, 2025
6380d36
Fix install
victor1234 Jan 19, 2025
fd13ffe
Fix install
victor1234 Jan 19, 2025
468ca4a
Fix install
victor1234 Jan 19, 2025
dcdf2bf
Fix install
victor1234 Jan 19, 2025
f3bb619
Renove windows
victor1234 Jan 19, 2025
fa855ef
Add build_tests option to action
victor1234 Jan 19, 2025
356df05
Fix build tests
victor1234 Jan 19, 2025
df1582c
Fix run tests
victor1234 Jan 19, 2025
aae2e4f
Check windows
victor1234 Jan 19, 2025
fac4c76
Fix ci
victor1234 Jan 19, 2025
d9c54f9
Fix
victor1234 Jan 19, 2025
8e17fa8
Add std::chrono option logic to conanfile
victor1234 Jan 19, 2025
3d81126
Add requirements method
victor1234 Jan 19, 2025
4210a36
Uncomment
victor1234 Jan 19, 2025
47b80f8
Add cmake build action
victor1234 Jan 19, 2025
f54591f
Install OpenSSL for windows
victor1234 Jan 19, 2025
fd88ca1
Update changelog
victor1234 Jan 19, 2025
e854d85
add jira ticket id
atimin Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ IncludeCategories:
Priority: 3
SortPriority: 0

ColumnLimit: 120
ColumnLimit: 120
50 changes: 50 additions & 0 deletions .github/actions/build-package-cmake/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "build-package-cmake"
description: "Install package and build example"
inputs:
build_tests:
default: "false"
install:
default: "true"
description: "Install the package after build"
runs:
using: "composite"
steps:
- name: Detect OS and install OpenSSL
shell: bash
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
choco install openssl -y
openssl version
fi

- name: Detect OS and set std::chrono flag
shell: bash
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
echo "USE_CHRONO=OFF" >> $GITHUB_ENV
elif [[ "${{ runner.os }}" == "Windows" ]]; then
echo "USE_CHRONO=ON" >> $GITHUB_ENV
fi
- name: Cmake configuration without tests
if: ${{inputs.build_tests == 'false'}}
shell: bash
run: cmake -S . -B build -DREDUCT_CPP_USE_STD_CHRONO=$USE_CHRONO

- name: Cmake configuration with tests
if: ${{inputs.build_tests == 'true'}}
shell: bash
run: cmake -S . -B build -DREDUCT_CPP_ENABLE_TESTS=ON -DREDUCT_CPP_USE_STD_CHRONO=$USE_CHRONO

- name: Build package
shell: bash
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
cmake --build build
elif [[ "${{ runner.os }}" == "Windows" ]]; then
cmake --build build --config Release
fi

- name: Install package
if: ${{inputs.install == 'true' }}
run: sudo cmake --install build
shell: bash
45 changes: 35 additions & 10 deletions .github/actions/build-package/action.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,49 @@
name: "build-package"
description: "Install package and build example"
inputs:
build_tests:
default: "false"
install:
default: "true"
description: "Install the package after build"
runs:
using: "composite"
steps:
- uses: ./.github/actions/install-conan

- name: Run conan install
shell: bash
run: conan install . --build=missing -s:a=compiler.cppstd=20

- name: Detect OS and set preset name
shell: bash
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
echo "PRESET=conan-release" >> $GITHUB_ENV
elif [[ "${{ runner.os }}" == "Windows" ]]; then
echo "PRESET=conan-default" >> $GITHUB_ENV
fi

- name: Cmake configuration without tests
if: ${{inputs.build_tests == 'false'}}
shell: bash
run: cmake --preset $PRESET

- name: Cmake configuration with tests
if: ${{inputs.build_tests == 'true'}}
shell: bash
run: cmake --preset $PRESET -DREDUCT_CPP_ENABLE_TESTS=ON

- name: Build package
shell: bash
run: cmake -DCMAKE_BUILD_TYPE=Debug -DREDUCT_CPP_ENABLE_EXAMPLES=ON -DREDUCT_CPP_ENABLE_TESTS=ON -S . -B build
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
cmake --build --preset $PRESET
elif [[ "${{ runner.os }}" == "Windows" ]]; then
cmake --build build --config Release
fi

- name: Install package
if: ${{inputs.install == 'true' }}
run: sudo cmake --install build/Release
shell: bash
run: sudo cmake --build build --target install
- name: Build example
if: ${{inputs.install == 'true' }}
shell: bash
run: |
mkdir examples/build
cd examples/build
cmake ..
cmake --build .
12 changes: 12 additions & 0 deletions .github/actions/install-conan/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "install-conan"

runs:
using: "composite"
steps:
- name: Install conan
shell: bash
run: pip3 install conan==2.11.0

- name: Create profile
shell: bash
run: conan profile detect
10 changes: 5 additions & 5 deletions .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ name: "run-tests"
description: "Pull storage and run tests"
inputs:
api-token: # id of input
description: 'API_TOKEN'
description: "API_TOKEN"
required: false
default: ""
tags: # id of input
description: 'Tags for tests'
description: "Tags for tests"
required: false
default: ""
reductstore-version: # id of input
description: 'Reduct Store version'
description: "Reduct Store version"
required: false
default: "main"
lic_file: # id of input
description: 'License file'
description: "License file"
required: true
runs:
using: "composite"
Expand All @@ -33,4 +33,4 @@ runs:
docker logs reduct-store
- name: Run tests
shell: bash
run: REDUCT_CPP_TOKEN_API=${{inputs.api-token}} build/bin/reduct-tests ${{inputs.tags}}
run: REDUCT_CPP_TOKEN_API=${{inputs.api-token}} build/Release/bin/reduct-tests ${{inputs.tags}}
34 changes: 23 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: ci
on:
push:
branches: [ main ]
branches: [main]
tags:
- 'v*'
- "v*"
pull_request:
branches: [ main ]
branches: [main]
jobs:
cpplint:
runs-on: ubuntu-latest
Expand All @@ -26,28 +26,35 @@ jobs:
needs: cpplint
strategy:
matrix:
build_type: [ "cmake", "conan" ]
os: [ ubuntu-22.04, windows-2019 ]
build_type: ["cmake", "conan"]
os: [ubuntu-22.04, windows-2019]
include:
- os: ubuntu-22.04
install: "true"
- os: windows-2019
install: "false"
steps:
- uses: actions/checkout@v4
- name: Install conan
with:
fetch-depth: 0
- name: Build without conan
if: ${{ matrix.build_type == 'cmake' }}
uses: ./.github/actions/build-package-cmake
with:
install: ${{ matrix.install }}

- name: Build with conan
if: ${{ matrix.build_type == 'conan' }}
run: pip3 install conan==1.64.1
- uses: ./.github/actions/build-package
uses: ./.github/actions/build-package
with:
install: ${{ matrix.install }}

unit-tests:
strategy:
matrix:
token: [ "", "TOKEN" ]
reductstore_version: [ "main", "latest" ]
license_file: [ "", "lic.key" ]
token: ["", "TOKEN"]
reductstore_version: ["main", "latest"]
license_file: ["", "lic.key"]
include:
- token: ""
exclude_token_api_tag: "~[token_api]"
Expand All @@ -65,7 +72,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: ./.github/actions/build-package
with:
build_tests: true

- name: Generate license
run: echo '${{secrets.LICENSE_KEY}}' > lic.key
Expand Down
39 changes: 27 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files

- repo: https://github.com/BlankSpruce/gersemi
rev: 0.17.1
hooks:
- id: gersemi

- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

- repo: local
- repo: local
hooks:
- id: cpplint
name: cpplint
description: Static code analysis of C/C++ files
language: python
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
entry: cpplint
- id: cpplint
name: cpplint
description: Static code analysis of C/C++ files
language: python
files: \.(h\+\+|h|hh|hxx|hpp|cuh|c|cc|cpp|cu|c\+\+|cxx|tpp|txx)$
entry: cpplint
30 changes: 5 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- RS-550: Add when condition to replication settings, [PR-80](https://github.com/reductstore/reduct-cpp/pull/80)

### Changed

- RS-563: Support for Conan v2, [PR-83](https://github.com/reductstore/reduct-cpp/pull/83)

## [1.13.0] - 2024-12-04

### Added
Expand Down Expand Up @@ -150,7 +154,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

- `Bucket.list`, [PR-42](https://github.com/reduct-storage/reduct-cpp/pull/42)
- `Bucket.list`, [PR-42](https://github.com/reduct-storage/reduct-cpp/pull/42)

### Changed

Expand Down Expand Up @@ -231,51 +235,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Initial implementation of Reduct Storage API v0.1.0

[Unreleased]: https://github.com/reduct-storage/reduct-cpp/compare/v1.13.0...HEAD

[1.13.0]: https://github.com/reduct-storage/reduct-cpp/compare/v1.12.0...1.13.0

[1.12.0]: https://github.com/reduct-storage/reduct-cpp/compare/v1.11.0...1.12.0

[1.11.0]: https://github.com/reduct-storage/reduct-cpp/compare/v1.10.0...1.11.0

[1.10.0]: https://github.com/reduct-storage/reduct-cpp/compare/v1.9.0...1.10.0

[1.9.0]: https://github.com/reduct-storage/reduct-cpp/compare/v1.8.0...1.9.0

[1.8.0]: https://github.com/reduct-storage/reduct-cpp/compare/v1.7.1...1.8.0

[1.7.1]: https://github.com/reduct-storage/reduct-cpp/compare/v1.7.0...1.7.1

[1.7.0]: https://github.com/reduct-storage/reduct-cpp/compare/v1.6.0...1.7.0

[1.6.0]: https://github.com/reduct-storage/reduct-cpp/compare/v1.5.0...1.6.0

[1.5.0]: https://github.com/reduct-storage/reduct-cpp/compare/v1.4.0...1.5.0

[1.4.0]: https://github.com/reduct-storage/reduct-cpp/compare/v1.3.0...1.4.0

[1.3.0]: https://github.com/reduct-storage/reduct-cpp/compare/v1.2.0...1.3.0

[1.2.0]: https://github.com/reduct-storage/reduct-cpp/compare/v1.1.0...1.2.0

[1.1.0]: https://github.com/reduct-storage/reduct-cpp/compare/v1.0.1...1.1.0

[1.0.1]: https://github.com/reduct-storage/reduct-cpp/compare/v1.0.0...1.0.1

[1.0.0]: https://github.com/reduct-storage/reduct-cpp/compare/v0.8.0...1.0.0

[0.8.0]: https://github.com/reduct-storage/reduct-cpp/compare/v0.7.0...v0.8.0

[0.7.0]: https://github.com/reduct-storage/reduct-cpp/compare/v0.6.0...v0.7.0

[0.6.0]: https://github.com/reduct-storage/reduct-cpp/compare/v0.5.0...v0.6.0

[0.5.0]: https://github.com/reduct-storage/reduct-cpp/compare/v0.4.0...v0.5.0

[0.4.0]: https://github.com/reduct-storage/reduct-cpp/compare/v0.3.0...v0.4.0

[0.3.0]: https://github.com/reduct-storage/reduct-cpp/compare/v0.2.0...v0.3.0

[0.2.0]: https://github.com/reduct-storage/reduct-cpp/compare/v0.1.0...v0.2.0

[0.1.0]: https://github.com/reduct-storage/reduct-cpp/releases/tag/v0.1.0
22 changes: 17 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,30 @@ project(reductcpp VERSION ${REDUCT_CPP_FULL_VERSION})
message(STATUS "Version ${REDUCT_CPP_FULL_VERSION}")

set(REDUCT_CPP_ENABLE_TESTS OFF CACHE BOOL "Compile tests")
set(REDUCT_CPP_USE_STD_CHRONO OFF CACHE BOOL "use std::chrono instead of date library")
set(REDUCT_CPP_USE_STD_CHRONO
OFF
CACHE BOOL
"use std::chrono instead of date library"
)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)

include(cmake/InstallDependencies.cmake)

configure_file(cmake/ReductCppConfig.cmake.in ${CMAKE_BINARY_DIR}/cmake/ReductCppConfig.cmake @ONLY)
configure_file(cmake/ReductCppConfigVersion.cmake.in ${CMAKE_BINARY_DIR}/cmake/ReductCppConfigVersion.cmake @ONLY)
configure_file(
cmake/ReductCppConfig.cmake.in
${CMAKE_BINARY_DIR}/cmake/ReductCppConfig.cmake
@ONLY
)
configure_file(
cmake/ReductCppConfigVersion.cmake.in
${CMAKE_BINARY_DIR}/cmake/ReductCppConfigVersion.cmake
@ONLY
)

add_subdirectory(src)
if (REDUCT_CPP_ENABLE_TESTS)
if(REDUCT_CPP_ENABLE_TESTS)
add_subdirectory(tests)
endif ()
endif()
2 changes: 1 addition & 1 deletion CPPLINT.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
filter=-build/c++11,-build/header_guard,-build/include
linelength=120
linelength=120
Loading
Loading