Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALP-69: Configure github actions to run unit tests #6

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Run Catch2 unit tests
define: $runner_version ubuntu-latest

on:
pull_request:
types:
- closed
pull_request_review:
types: [submitted]
schedule:
- cron: '0 1 * * 1'

jobs:

get-catch:
runs-on: *runner_version
steps:
- name: clone catch2 repo
run: git clone https://github.com/catchorg/Catch2.git && cd Catch2
- name: configure build
run: cmake -B build -S .
- name: build
run: cmake --build build -j ${nproc-2}

build:
needs: get-catch
runs-on: *runner_version
steps:
- uses: actions/checkout@v3
- name: set up packages
run: xargs sudo apt -y install < packages.txt
- name: configure
run: cmake -B build -S . -DBUILD_TESTS=ON
- name: build
run: cmake --build build -j ${nproc-2}

approved:
if: github.event.review.state == 'APPROVED'
needs: build
runs-on: *runner_version
steps:
- run: cd build/ && ctest

pr-merged:
if: github.event.pull_request.merged == true
needs: build
runs-on: *runner_version
steps:
- run: cd build/ && ctest

scheduled_test:
needs: build
runs-on: *runner_version
steps:
- run: cd build/ && ctest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ build*
compile_commands.json
.cache
docs/
Testing/
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ if(BUILD_TESTS)
find_package(Catch2 3 REQUIRED)
include(CTest)
include(Catch)
enable_testing()
endif()

# source configuration
Expand Down
2 changes: 2 additions & 0 deletions package_list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
libeigen3-dev
cmake