Skip to content

Commit

Permalink
Add CI job for macOS (#2222)
Browse files Browse the repository at this point in the history
* Add CI job for macOS

* Add 

* Fix rust example

* Minor typo fix

* Set C API test buffer size

* Use the correct system config.

* Setup rust env
  • Loading branch information
mewim committed Oct 17, 2023
1 parent 2da282a commit 5ce92b8
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 5 deletions.
66 changes: 63 additions & 3 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
uses: codecov/codecov-action@v3
with:
file: cover.info
functionalities: 'search'
functionalities: "search"

- name: C and C++ Examples
run: |
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Ensure python dependencies
- name: Ensure Python dependencies
run: |
pip install torch~=2.0.0 --extra-index-url https://download.pytorch.org/whl/cpu &&\
pip install --user -r tools/python_api/requirements_dev.txt -f https://data.pyg.org/whl/torch-2.0.0+cpu.html
Expand Down Expand Up @@ -159,7 +159,6 @@ jobs:
- name: Run clang-tidy on examples
run: run-clang-tidy -p build/release -quiet -j 32 "^$(realpath examples)"


msvc-build-test:
name: msvc build & test
needs: [clang-formatting-check, header-include-guard-check]
Expand Down Expand Up @@ -254,3 +253,64 @@ jobs:

- name: Benchmark
run: python3 benchmark/benchmark_runner.py --dataset ldbc-sf100 --thread 10

macos-build-test:
name: apple clang build & test
needs: [clang-formatting-check, header-include-guard-check, rustfmt-check]
runs-on: self-hosted-mac-x64
steps:
- uses: actions/checkout@v3

- name: Ensure Python dependencies
run: |
pip3 install torch~=2.0.0 --extra-index-url https://download.pytorch.org/whl/cpu &&\
pip3 install --user -r tools/python_api/requirements_dev.txt -f https://data.pyg.org/whl/torch-2.0.0+cpu.html
- name: Ensure Node.js dependencies
run: npm install --include=dev
working-directory: tools/nodejs_api

- name: Build
run: make release NUM_THREADS=32

- name: Test
run: |
ulimit -n 10240
make test NUM_THREADS=32
- name: Python test
run: |
ulimit -n 10240
make pytest NUM_THREADS=32
- name: C and C++ Examples
run: |
ulimit -n 10240
make example NUM_THREADS=32
- name: Node.js test
run: |
ulimit -n 10240
make nodejstest NUM_THREADS=32
- name: Java test
run: |
ulimit -n 10240
make javatest NUM_THREADS=32
- name: Rust share build
# Share build cache when building rust API and the example project
run: echo $'[workspace]\nmembers = ["tools/rust_api","examples/rust"]' > Cargo.toml

- name: Rust test
run: |
ulimit -n 10240
source /Users/runner/.cargo/env
make rusttest NUM_THREADS=32
- name: Rust example
working-directory: examples/rust
run: |
ulimit -n 10240
source /Users/runner/.cargo/env
cargo build --features arrow
4 changes: 3 additions & 1 deletion test/c_api/database_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ class CApiDatabaseTest : public APIEmptyDBTest {

TEST_F(CApiDatabaseTest, CreationAndDestroy) {
auto databasePathCStr = databasePath.c_str();
auto database = kuzu_database_init(databasePathCStr, kuzu_default_system_config());
auto systemConfig = kuzu_default_system_config();
systemConfig.buffer_pool_size = 512 * 1024;
auto database = kuzu_database_init(databasePathCStr, systemConfig);
ASSERT_NE(database, nullptr);
ASSERT_NE(database->_database, nullptr);
auto databaseCpp = static_cast<Database*>(database->_database);
Expand Down
4 changes: 3 additions & 1 deletion test/include/c_api_test/c_api_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ class CApiTest : public APIDBTest {
database.reset();
auto databasePath = getDatabasePath();
auto databasePathCStr = databasePath.c_str();
_database = kuzu_database_init(databasePathCStr, kuzu_default_system_config());
auto systemConfig = kuzu_default_system_config();
systemConfig.buffer_pool_size = 512 * 1024 * 1024;
_database = kuzu_database_init(databasePathCStr, systemConfig);
connection = kuzu_connection_init(_database);
}

Expand Down

0 comments on commit 5ce92b8

Please sign in to comment.