Skip to content

Commit

Permalink
Github action update
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhjp01 committed Nov 27, 2023
1 parent 9bb35b1 commit a802991
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ jobs:
run: |
conan profile detect
conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force
- name: Cache conan
id: cache-conan
uses: actions/cache@v3
with:
path: $HOME/.conan2
key: ${{ matrix.os }}
- name: Install dependencies
run: conan install --build=missing --output-folder=build .
run: conan install --build=missing --output-folder=build -s build_type=${{ matrix.build_type }} .
- name: Generate build system
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake -DPROXYFMU_BUILD_EXAMPLES=ON -DPROXYFMU_BUILD_TESTS=ON
run: cmake --preset conan-$(echo ${{ matrix.build_type }} | tr '[:upper:]' '[:lower:]') -DPROXYFMU_BUILD_EXAMPLES=ON -DPROXYFMU_BUILD_TESTS=ON
- name: Build
run: cmake --build build
run: cmake --build --preset conan-$(echo ${{ matrix.build_type }} | tr '[:upper:]' '[:lower:]')
- name: Test
run: |
cd build/tests
Expand All @@ -51,12 +57,18 @@ jobs:
run: |
conan profile detect
conan remote add osp https://osp.jfrog.io/artifactory/api/conan/conan-local --force
- name: Cache conan
id: cache-conan
uses: actions/cache@v3
with:
path: $HOME/.conan2
key: ${{ matrix.os }}
- name: Install dependencies
run: conan install --build=missing --output-folder=build .
run: conan install --build=missing --output-folder=build -s build_type=${{ matrix.build_type }} .
- name: Generate build system
run: cmake -A x64 -B build -S . "-DCMAKE_TOOLCHAIN_FILE=build\conan_toolchain.cmake" -DPROXYFMU_BUILD_EXAMPLES=ON -DPROXYFMU_BUILD_TESTS=ON -B build -S .
run: cmake --preset conan-default -DPROXYFMU_BUILD_EXAMPLES=ON -DPROXYFMU_BUILD_TESTS=ON
- name: Build
run: cmake --build build --config ${{ matrix.build_type }}
run: cmake --build --preset "conan-${{ matrix.build_type }}".ToLower()
- name: Test
run: |
cd build/tests
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
thrift.*

cmake-build-*

CMakeUserPresets.json
8 changes: 8 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ target_link_libraries(test_controlled_temp PRIVATE proxyfmu-client)

add_executable(test_mass-spring-damper test_mass-spring-damper.cpp)
add_test(NAME test_mass-spring-damper COMMAND test_mass-spring-damper)

set_tests_properties(
test_identity
test_controlled_temp
test_mass-spring-damper
PROPERTIES
ENVIRONMENT "PATH=$<SHELL_PATH:$<TARGET_FILE_DIR:proxyfmu-client>\;>$ENV{PATH}"
)

0 comments on commit a802991

Please sign in to comment.