Skip to content

Commit a281d01

Browse files
authored
Merge pull request #2 from sreiter/github-ci
CI: Use github actions to implement CI
2 parents 94713ae + b219bf6 commit a281d01

File tree

4 files changed

+40
-10
lines changed

4 files changed

+40
-10
lines changed

.github/workflows/ubuntu-ctest.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Ubuntu CTest
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
env:
10+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
11+
BUILD_TYPE: Release
12+
13+
jobs:
14+
build:
15+
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
16+
# You can convert this to a matrix build if you need cross-platform coverage.
17+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Configure CMake
24+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
25+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
26+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DMOOSE_BUILD_SAMPLE=ON -DMOOSE_BUILD_TESTS=ON
27+
28+
- name: Build
29+
# Build your program with the given configuration
30+
run: cmake --build ${{github.workspace}}/build
31+
32+
- name: Test
33+
working-directory: ${{github.workspace}}/build/tests
34+
# Execute tests defined by the CMake configuration.
35+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
36+
run: ctest

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
.cache
12
compile_commands.json

.travis.yml

-10
This file was deleted.

tests/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
1616
FetchContent_MakeAvailable (googletest)
1717

1818
target_link_libraries (moose_tests gtest_main moose)
19+
20+
enable_testing()
21+
add_test(NAME moose_ctest COMMAND moose_tests)

0 commit comments

Comments
 (0)