Skip to content

Commit

Permalink
pass target framework that should be used for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffmann-stefan committed Apr 15, 2023
1 parent 44d23d0 commit eccde6f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ jobs:
os: ['ubuntu-20.04', 'ubuntu-22.04']
include:
- os: ubuntu-20.04
test_target_framework: netcoreapp2.0
ros_distribution: foxy
ros_version: 2
- os: ubuntu-22.04
test_target_framework: net6
ros_distribution: humble
ros_version: 2

runs-on: ${{ matrix.os }}
env:
RCLDOTNET_TEST_TARGET_FRAMEWORK: ${{ matrix.test_target_framework }}

steps:
- name: Checkout source
Expand Down
10 changes: 10 additions & 0 deletions rcldotnet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,17 @@ if(BUILD_TESTING)
${builtin_interfaces_ASSEMBLIES_DLL}
)

# Used by CI to test the different target frameworks in a matrix.
if(DEFINED ENV{RCLDOTNET_TEST_TARGET_FRAMEWORK})
set(RCLDOTNET_TEST_TARGET_FRAMEWORK $ENV{RCLDOTNET_TEST_TARGET_FRAMEWORK})
else()
set(RCLDOTNET_TEST_TARGET_FRAMEWORK "")
endif()

add_dotnet_test(test_messages
TARGET_FRAMEWORK
${RCLDOTNET_TEST_TARGET_FRAMEWORK}
SOURCES
${CS_SOURCES}
test/test_messages.cs
INCLUDE_DLLS
Expand Down

0 comments on commit eccde6f

Please sign in to comment.