Skip to content

Commit 6402b73

Browse files
Fixing runinng unit tests on MacOS
1 parent 0a996cf commit 6402b73

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

.github/workflows/test.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,20 @@ jobs:
2222
image: ghcr.io/viam-modules/viam-camera-realsense:amd64
2323
options: --platform linux/amd64
2424
- os: macos-latest
25-
container:
26-
image: ghcr.io/viam-modules/viam-camera-realsense:macos
27-
options: --platform macos/arm64
25+
container: null
2826

27+
runs-on: ${{ matrix.os }}
2928
container: ${{ matrix.container }}
3029

3130
steps:
3231
- name: Checkout code
3332
uses: actions/checkout@v3
3433

34+
- name: Install dependencies (macOS)
35+
if: matrix.os == 'macos-latest'
36+
run: |
37+
make setup
38+
./bin/build_librealsense_macos.sh
39+
3540
- name: Run the tests
3641
run: make test-native

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,16 @@ test: conan-install-test conan-build-test
5353
cd build-conan/build/RelWithDebInfo && . ./generators/conanrun.sh && ctest --output-on-failure
5454

5555
# Native build targets for CI environments with pre-installed dependencies
56+
ifeq ($(UNAME_S),Darwin)
57+
NPROC := $(shell sysctl -n hw.ncpu)
58+
else
59+
NPROC := $(shell nproc)
60+
endif
61+
5662
build-native:
5763
mkdir -p build-native && cd build-native && \
5864
cmake .. -DVIAM_REALSENSE_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo && \
59-
make -j$(shell nproc)
65+
make -j$(NPROC)
6066

6167
test-native: build-native
6268
cd build-native && ctest --output-on-failure

0 commit comments

Comments
 (0)