Skip to content

Commit

Permalink
github-actions: Add basic build + unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonKagstrom committed Jun 21, 2024
1 parent d48ccd4 commit 76d47a9
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [SimonKagstrom]
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: EmilPRO CI

on: [push, pull_request]

jobs:
build:

strategy:
matrix:
os: [ubuntu-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2

- name: Install dependencies
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
sudo apt-get install -y g++ cmake ninja-build python3-pip binutils-multiarch-dev qt6-base-dev
pip3 install conan
else
brew install cmake ninja conan binutils qt6
fi
conan profile new default --detect
- name: Install conan deps
run: conan install -of ${{github.workspace}}/build --build=missing -s build_type=Debug

- name: Configure CMake
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
cmake -GNinja -DCMAKE_PREFIX_PATH="${{github.workspace}}/build/build/Debug/generators/" -DCMAKE_BUILD_TYPE=Debug
else
cmake -GNinja -DCMAKE_PREFIX_PATH="${{github.workspace}}/build/build/Debug/generators/;`brew --prefix binutils`" -DCMAKE_BUILD_TYPE=Debug
fi
- name: Build
run: ninja -C ${{github.workspace}}/build

- name: Test
run: ctest -C ${{github.workspace}}/build
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ add_subdirectory(tools)

# Unit tests are only built in debug mode
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
enable_testing()
add_subdirectory(test)
endif()

Expand Down
2 changes: 2 additions & 0 deletions test/unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ target_link_libraries(ut
jump_lanes
fmt::fmt
)

add_test(NAME unittest COMMAND ut)

0 comments on commit 76d47a9

Please sign in to comment.