Skip to content

Commit

Permalink
Add c++ tests to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
markkohdev committed Aug 19, 2024
1 parent 598e9e6 commit e50b1e5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
34 changes: 31 additions & 3 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ jobs:
# TODO: Switch back to macos-latest once https://github.com/actions/python-versions/pull/114 is fixed
os:
- 'ubuntu-latest'
# TODO: Fix failing CMake build on windows:
# `cl : command line error D8016: '/O2' and '/RTC1' command-line options are incompatible [D:\a\voyager\voyager\cpp\test\test.vcxproj]`
- windows-latest
- macos-12
name: Test C++ on ${{ matrix.os }}
Expand All @@ -237,9 +239,35 @@ jobs:
submodules: recursive
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y pkg-config
- name: Build voyager locally
run: make test
run: sudo apt-get update && sudo apt-get install -y pkg-config
- name: Install CMake
run: sudo apt-get install -y cmake

- name: Configure CMake
run: cmake -S . -B build

- name: Build with CMake
run: cmake --build build

- name: Run Tests (if any)
run: ctest --test-dir build
# - name: Run CMake (Linux & MacOS)
# if: runner.os != 'Windows'
# uses: threeal/cmake-action@v2.0.0
# with:
# source-dir: cpp
# build-dir: cpp
# - name: Run CMake (Windows)
# if: runner.os == 'Windows'
# uses: threeal/cmake-action@v2.0.0
# with:
# source-dir: cpp
# build-dir: cpp
# cxx-flags: /Od # Disable optimization (since it breaks CMake on Windows)
# - name: Build C++
# run: make test
# - name: Run tests
# run: ./test/test

build-python-wheels:
needs: [run-python-tests, run-python-tests-with-address-sanitizer]
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ TEST_CASE("Test combinations of different instantiations and sizes") {
testCombination(index, spaceType, numDimensions, storageType);
} else if (storageType == StorageDataType::E4M3) {
auto index = TypedIndex<float, E4M3>(spaceType, numDimensions);
testCombination(index, spaceType, 20, storageType);
testCombination(index, spaceType, numDimensions, storageType);
}
}
}
Expand Down

0 comments on commit e50b1e5

Please sign in to comment.