-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an action for unit testing. (#11)
Add an action for unit testing.
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Unit test | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'src/**' | ||
- 'tests/**' | ||
- '.github/workflows/ut.yml' | ||
jobs: | ||
class: | ||
runs-on: "ubuntu-22.04" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Install gMock and Ninja | ||
run: sudo apt-get install -y libgmock-dev ninja-build | ||
|
||
- name: Run tests | ||
run: | | ||
cmake -G Ninja -S tests -B build-tests | ||
cmake --build build-tests | ||
ctest --test-dir build-tests |