-
Notifications
You must be signed in to change notification settings - Fork 13
51 lines (41 loc) · 1.47 KB
/
gtest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: GTest tests
on:
workflow_dispatch:
push:
branches: [develop]
pull_request:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
# TODO: Revert back to Release once the issue is fixed
# https://github.com/actions/runner-images/issues/10004
# BUILD_TYPE: Release
BUILD_TYPE: Debug
CMAKE_BUILD_PARALLEL_LEVEL: 2
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
[ubuntu-latest, windows-latest]
# os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Install linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -qq libusb-1.0-0-dev
- name: Install osx dependencies
if: matrix.os == 'macos-latest'
run: brew install libusb
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_SHARED_LIBS=OFF -DENABLE_UNIT_TESTS=on -DBUILD_GUI=off
- name: Build tests
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target gtest-runner
- name: Run tests (Linux)
if: matrix.os != 'windows-latest'
run: ${{github.workspace}}/build/bin/gtest-runner
- name: Run tests (Windows)
if: matrix.os == 'windows-latest'
run: ${{github.workspace}}/build/bin/${{env.BUILD_TYPE}}/gtest-runner.exe