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

Create an example of including UnoDB as a CMake subdirectory #633

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
81 changes: 67 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ jobs:
resource_class: arm.medium
steps:
- checkout
- run:
name: Checkout submodules
command: git submodule update --init
- run:
name: Installing dependencies (common)
command: |
Expand Down Expand Up @@ -70,6 +67,44 @@ jobs:
- run:
name: Create build environment
command: mkdir build
- when:
condition:
not:
or:
- << parameters.asan >>
- << parameters.tsan >>
- << parameters.ubsan >>
steps:
- run:
name: Create build environment (examples)
command: mkdir build/build-examples
- run:
name: Installing dependencies (examples)
command: |
sudo apt-get install libmsgsl-dev
- run:
name: Configure CMake (examples)
working_directory: build/build-examples
command: |
readonly BUILD_TYPE=<< parameters.build_type >>
readonly COMPILER=<< parameters.compiler >>
if [[ $COMPILER == "gcc" ]]; then
V=13
export CC=gcc-$V
export CXX=g++-$V
elif [[ $COMPILER == "clang" ]]; then
V=19
export CC=clang-$V
export CXX=clang++-$V
fi
cmake ../../examples -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- run:
name: Examples
working_directory: build/build-examples
command: make -j2 examples
- run:
name: Checkout submodules
command: git submodule update --init
- run:
name: Configure CMake
working_directory: build
Expand Down Expand Up @@ -107,10 +142,6 @@ jobs:
name: Build
working_directory: build
command: make -j2
- run:
name: Examples
working_directory: build
command: make examples
- run:
name: Correctness test
working_directory: build
Expand Down Expand Up @@ -160,9 +191,6 @@ jobs:
resource_class: macos.m1.medium.gen1
steps:
- checkout
- run:
name: Checkout submodules
command: git submodule update --init --recursive
- run:
name: Install dependencies
command: |
Expand All @@ -171,6 +199,35 @@ jobs:
- run:
name: Create build environment
command: mkdir build
- when:
condition:
not:
or:
- << parameters.asan >>
- << parameters.tsan >>
- << parameters.ubsan >>
steps:
- run:
name: Create build environment (examples)
command: mkdir build/build-examples
- run:
name: Installing dependencies (examples)
command: brew install cpp-gsl googletest google-benchmark
- run:
name: Configure CMake (examples)
working_directory: build/build-examples
command: |
readonly BUILD_TYPE=<< parameters.build_type >>
export CC=clang
export CXX=clang++
cmake ../../examples -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- run:
name: Examples
working_directory: build/build-examples
command: make -j3 examples
- run:
name: Checkout submodules
command: git submodule update --init --recursive
- run:
name: Configure CMake
working_directory: build
Expand All @@ -188,10 +245,6 @@ jobs:
name: Build
working_directory: build
command: make -j3
- run:
name: Examples
working_directory: build
command: make examples
- run:
name: Correctness test
working_directory: build
Expand Down
69 changes: 60 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: true
submodules: false

- name: Setup common dependencies for Linux
run: |
Expand Down Expand Up @@ -340,6 +340,13 @@ jobs:
sudo cpanm install JSON
if: runner.os == 'Linux' && env.COVERAGE == 'ON'

- name: Set up dependencies for Linux (examples)
run: sudo apt-get install libmsgsl-dev
if: >
env.SANITIZE_ADDRESS != 'ON' && env.SANITIZE_THREAD != 'ON'
&& env.SANITIZE_UB != 'ON' && env.STATIC_ANALYSIS != 'ON'
&& runner.os == 'Linux' && env.COVERAGE != 'ON'

- name: Set up dependencies for macOS (common)
run: |
brew install boost include-what-you-use python-setuptools
Expand All @@ -349,15 +356,64 @@ jobs:
run: brew install cppcheck
if: runner.os == 'macOS' && env.CPPCHECK == 'ON'

- name: Create build environment
run: mkdir ${{github.workspace}}/build
- name: Set up dependencies for macOS (examples)
run: brew install cpp-gsl
if: >
env.SANITIZE_ADDRESS != 'ON' && env.SANITIZE_THREAD != 'ON'
&& env.SANITIZE_UB != 'ON' && env.STATIC_ANALYSIS != 'ON'
&& runner.os == 'macOS' && env.COVERAGE != 'ON'

- name: Configure CMake (examples)
# Use a bash shell so we can use the same syntax for environment
# variable access regardless of the host operating system
shell: bash
run: |
mkdir ${{github.workspace}}/build-examples
cd ${{github.workspace}}/build-examples
COMPILER="${COMPILER:-$DEFAULT_COMPILER}"
export PATH="$HOME/.local/bin:$PATH"
if [[ -n "$BUILD_TYPE" ]]; then
CBT="-DCMAKE_BUILD_TYPE=$BUILD_TYPE"
else
CBT=""
fi
if [[ $COMPILER == "gcc" ]]; then
V=13
export CC=gcc-$V
export CXX=g++-$V
elif [[ $COMPILER == "clang" ]]; then
V=19
export CC=clang-$V
export CXX=clang++-$V
elif [[ $COMPILER == "macos-clang" ]]; then
export CC=clang
export CXX=clang++
fi
cmake "$GITHUB_WORKSPACE/examples" "$CBT"
if: >
env.SANITIZE_ADDRESS != 'ON' && env.SANITIZE_THREAD != 'ON'
&& env.SANITIZE_UB != 'ON' && env.STATIC_ANALYSIS != 'ON'
&& env.COVERAGE != 'ON'

- name: Examples
working-directory: ${{github.workspace}}/build-examples
run: make -j3 examples
if: >
env.SANITIZE_ADDRESS != 'ON' && env.SANITIZE_THREAD != 'ON'
&& env.SANITIZE_UB != 'ON' && env.STATIC_ANALYSIS != 'ON'
&& env.COVERAGE != 'ON'

- uses: actions/checkout@v4
with:
submodules: true

- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment
# variable access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
run: |
mkdir ${{github.workspace}}/build
cd ${{github.workspace}}/build
COMPILER="${COMPILER:-$DEFAULT_COMPILER}"
SANITIZE_ADDRESS="${SANITIZE_ADDRESS:-$DEFAULT_SANITIZE_ADDRESS}"
SANITIZE_THREAD="${SANITIZE_THREAD:-$DEFAULT_SANITIZE_THREAD}"
Expand Down Expand Up @@ -426,11 +482,6 @@ jobs:
--force-analyze-debug-code make -j3;
if: env.STATIC_ANALYSIS == 'ON' && env.COMPILER == 'clang'

- name: Examples
working-directory: ${{github.workspace}}/build
run: make examples
if: env.STATIC_ANALYSIS != 'ON' && env.COVERAGE != 'ON'

- name: Correctness test
working-directory: ${{github.workspace}}/build
run: ctest -j3 -V
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/msvc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,6 @@ jobs:
&& (matrix.preset == 'msvc-static-analysis-release'
|| matrix.preset == 'msvc-static-analysis-debug')

- name: Examples
run: |
$Env:P = "${{ matrix.preset }}"
cmake --build --preset "$env:P" --target examples
if: >
(matrix.preset != 'msvc-static-analysis-release')
&& (matrix.preset != 'msvc-static-analysis-debug')

- name: Correctness test
run: ctest -V --preset "${{ matrix.preset }}"
if: >
Expand Down
46 changes: 39 additions & 7 deletions .github/workflows/old-compilers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: true
submodules: false

- name: Setup common dependencies
run: |
Expand Down Expand Up @@ -485,15 +485,51 @@ jobs:
sudo apt-get install -y gcc
if: env.COMPILER == 'gcc' && env.VERSION == '11'

- name: Create build environment
run: mkdir ${{github.workspace}}/build
- name: Set up dependencies for examples
run: sudo apt-get install libmsgsl-dev
if: >
env.SANITIZE_ADDRESS != 'ON' && env.SANITIZE_THREAD != 'ON'
&& env.SANITIZE_UB != 'ON'

laurynas-biveinis marked this conversation as resolved.
Show resolved Hide resolved
- name: Configure CMake (examples)
# Use a bash shell so we can use the same syntax for environment
# variable access regardless of the host operating system
shell: bash
run: |
mkdir ${{github.workspace}}/build-examples
cd ${{github.workspace}}/build-examples
export PATH=$HOME/.local/bin:$PATH
if [[ $COMPILER == "gcc" ]]; then
export CC="gcc-${VERSION}"
export CXX="g++-${VERSION}"
else
export CC="clang-${VERSION}"
export CXX="clang++-${VERSION}"
fi
cmake "$GITHUB_WORKSPACE/examples" "-DCMAKE_BUILD_TYPE=$BUILD_TYPE"
if: >
env.SANITIZE_ADDRESS != 'ON' && env.SANITIZE_THREAD != 'ON'
&& env.SANITIZE_UB != 'ON'

- name: Examples
working-directory: ${{github.workspace}}/build-examples
run: make -j3 examples
if: >
env.SANITIZE_ADDRESS != 'ON' && env.SANITIZE_THREAD != 'ON'
&& env.SANITIZE_UB != 'ON'

- uses: actions/checkout@v4
with:
submodules: true

- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment
# variable access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
run: |
mkdir ${{github.workspace}}/build
cd ${{github.workspace}}/build
SANITIZE_ADDRESS="${SANITIZE_ADDRESS:-$DEFAULT_SANITIZE_ADDRESS}"
SANITIZE_THREAD="${SANITIZE_THREAD:-$DEFAULT_SANITIZE_THREAD}"
SANITIZE_UB="${SANITIZE_UB:-$DEFAULT_SANITIZE_UB}"
Expand Down Expand Up @@ -530,10 +566,6 @@ jobs:
working-directory: ${{github.workspace}}/build
run: make -j3

- name: Examples
working-directory: ${{github.workspace}}/build
run: make examples

- name: Correctness test
working-directory: ${{github.workspace}}/build
run: ctest -j3 -V
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/ubuntu-20.04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,13 @@ jobs:
"lld-${VERSION}"
if: env.COMPILER == 'clang' && env.BUILD_TYPE == 'Release'

- name: Create build environment
run: mkdir ${{github.workspace}}/build

- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment
# variable access regardless of the host operating system
shell: bash
working-directory: ${{github.workspace}}/build
run: |
mkdir ${{github.workspace}}/build
cd ${{github.workspace}}/build
SANITIZE_ADDRESS="${SANITIZE_ADDRESS:-$DEFAULT_SANITIZE_ADDRESS}"
SANITIZE_THREAD="${SANITIZE_THREAD:-$DEFAULT_SANITIZE_THREAD}"
SANITIZE_UB="${SANITIZE_UB:-$DEFAULT_SANITIZE_UB}"
Expand Down Expand Up @@ -232,10 +230,6 @@ jobs:
working-directory: ${{github.workspace}}/build
run: make -j3

- name: Examples
working-directory: ${{github.workspace}}/build
run: make examples

- name: Correctness test
working-directory: ${{github.workspace}}/build
run: ctest -j3 -V
Expand Down
Loading
Loading