Skip to content

Commit 6cb506a

Browse files
committed
BLD: Add GitHub CI actions
1 parent 76d7899 commit 6cb506a

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

.github/workflows/build.yaml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,29 @@ on:
77
branches: [main, dev]
88

99
jobs:
10-
build:
10+
ubuntu:
1111
strategy:
12-
fail-fast: false
1312
matrix:
14-
arch: [x64, ARM64]
15-
os: [ubuntu-latest, macos-latest, windows-latest]
16-
name: build - (${{ matrix.arch }} ${{ matrix.os }})
17-
runs-on: ${{ matrix.os }}
13+
compiler: [clang, gcc]
14+
15+
name: build - ubuntu-latest - (${{ matrix.compiler}})
16+
runs-on: ubuntu-latest
1817

1918
steps:
2019
- name: Checkout repository
2120
uses: actions/checkout@v3
21+
- name: Install dependencies
22+
run: sudo apt-get install libzstd-dev ninja-build libgtest-dev
23+
- name: Install gtest
24+
uses: MarkusJx/[email protected]
25+
- name: CMake configure
26+
run: cmake -S . -B build \
27+
-GNinja \
28+
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }} \
29+
-DCMAKE_ENABLE_EXAMPLES=1 \
30+
-DDATABENTO_ENABLE_CLANG_TIDY=1 \
31+
-DDATABENTO_ENABLE_CPPCHECK=1
32+
- name: CMake build
33+
run: cmake --build build
34+
- name: Unit tests
35+
run: cd build && ctest --verbose

test/cmake_fetch_content/project/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ project(DummyImport LANGUAGES CXX)
44

55
include(FetchContent)
66

7-
get_filename_component(GIT_REPOSITORY_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../../../.. ABSOLUTE)
7+
get_filename_component(GIT_REPOSITORY_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../.. ABSOLUTE)
88
set(DATABENTO_ENABLE_UNIT_TESTING OFF CACHE INTERNAL "")
99
FetchContent_Declare(
1010
databento
1111
GIT_REPOSITORY ${GIT_REPOSITORY_DIRECTORY}
1212
GIT_TAG HEAD
13-
SOURCE_SUBDIR public/databento-cpp
1413
)
1514
FetchContent_MakeAvailable(databento)
1615

test/src/stream_op_helper_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ TEST(StreamOpHelperTests, TestSingleLine) {
2929
EXPECT_EQ(stream.str(),
3030
"TestClass { schema = ohlcv-1d, dataset = \"XNAS.ITCH\", size = "
3131
"10, i8 = -10, u8 = 16 }");
32-
};
32+
}
3333

3434
TEST(StreamOpHelperTests, TestMultiLine) {
3535
std::ostringstream stream;
@@ -51,7 +51,7 @@ TEST(StreamOpHelperTests, TestMultiLine) {
5151
is_full = true,
5252
action = 'A'
5353
})");
54-
};
54+
}
5555

5656
TEST(StreamOpHelperTests, TestWithVector) {
5757
const std::vector<Schema> test_data{Schema::Ohlcv1D, Schema::Mbp10,

0 commit comments

Comments
 (0)