mirror of
https://github.com/eclipse/wakaama.git
synced 2025-05-08 15:28:14 +08:00
test: Add action dedicated to integration tests
This way it's easier to handle the different kind of tests.
This commit is contained in:
parent
e5d7daba36
commit
1cc77834c6
36
.github/workflows/build_and_test.yaml
vendored
36
.github/workflows/build_and_test.yaml
vendored
@ -18,6 +18,7 @@ jobs:
|
||||
matrix:
|
||||
sanitizer: ["address", "leak", "thread", "undefined"]
|
||||
compiler: ["clang-18", "gcc-13"]
|
||||
example: ["bootstrap_server", "client/udp", "client/tinydtls", "client/raw_block1", "lightclient", "server"]
|
||||
|
||||
steps:
|
||||
- name: Checkout code including full history and submodules
|
||||
@ -29,7 +30,7 @@ jobs:
|
||||
- name: Install dependencies from APT repository
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install cmake libcunit1-dev ninja-build unzip wget
|
||||
sudo apt-get install cmake libcunit1-dev ninja-build
|
||||
|
||||
- name: Build all binaries
|
||||
run: |
|
||||
@ -43,27 +44,22 @@ jobs:
|
||||
env:
|
||||
CC: ${{ matrix.compiler }}
|
||||
|
||||
- name: Build examples for integration tests
|
||||
- name: Build examples
|
||||
run: |
|
||||
for example in "server" "bootstrap_server" "client/udp"
|
||||
do
|
||||
echo "Building example ${example}"
|
||||
tools/ci/run_ci.sh \
|
||||
--run-clean \
|
||||
--run-build \
|
||||
--sanitizer ${{ matrix.sanitizer }} \
|
||||
--source-directory examples/${example} \
|
||||
--build-directory build-wakaama-${example}
|
||||
done
|
||||
tools/ci/run_ci.sh \
|
||||
--run-clean \
|
||||
--run-build \
|
||||
--sanitizer ${{ matrix.sanitizer }} \
|
||||
--source-directory examples/${{ matrix.example }} \
|
||||
--build-directory wakaama-build-${{ matrix.example }}
|
||||
env:
|
||||
CC: ${{ matrix.compiler }}
|
||||
|
||||
- name: Install dependencies
|
||||
- name: Unit test examples
|
||||
run: |
|
||||
pip install --require-hashes -r tests/integration/requirements.txt
|
||||
|
||||
- name: Execute integration tests
|
||||
run: |
|
||||
python -c "import sys; print(sys.version)"
|
||||
pytest -v tests/integration
|
||||
|
||||
tools/ci/run_ci.sh \
|
||||
--run-tests \
|
||||
--source-directory examples/${{ matrix.example }} \
|
||||
--build-directory wakaama-build-${{ matrix.example }}
|
||||
env:
|
||||
CC: ${{ matrix.compiler }}
|
||||
|
54
.github/workflows/integration_test.yaml
vendored
Normal file
54
.github/workflows/integration_test.yaml
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
name: Integration Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: '**'
|
||||
pull_request:
|
||||
branches: '**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build_and_test:
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
sanitizer: ["address", "leak", "thread", "undefined"]
|
||||
|
||||
steps:
|
||||
- name: Checkout code including full history and submodules
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install dependencies from APT repository
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install cmake libcunit1-dev ninja-build
|
||||
|
||||
- name: Build examples for integration tests
|
||||
run: |
|
||||
for example in "server" "bootstrap_server" "client/udp"
|
||||
do
|
||||
echo "Building example ${example}"
|
||||
tools/ci/run_ci.sh \
|
||||
--run-clean \
|
||||
--run-build \
|
||||
--sanitizer ${{ matrix.sanitizer }} \
|
||||
--run-tests \
|
||||
--source-directory examples/${example} \
|
||||
--build-directory build-wakaama-${example}
|
||||
done
|
||||
|
||||
- name: Install Python test dependencies
|
||||
run: |
|
||||
pip install --require-hashes -r tests/integration/requirements.txt
|
||||
|
||||
- name: Execute integration tests
|
||||
run: |
|
||||
python -c "import sys; print(sys.version)"
|
||||
pytest -v tests/integration
|
@ -13,3 +13,5 @@ add_subdirectory(../../ wakaama_lib)
|
||||
add_executable(bootstrap_server)
|
||||
target_sources(bootstrap_server PRIVATE bootstrap_info.c bootstrap_server.c bootstrap_info.h bootstrap_server.ini)
|
||||
target_link_libraries(bootstrap_server PRIVATE wakaama_static)
|
||||
|
||||
enable_testing()
|
||||
|
@ -33,3 +33,5 @@ target_sources(
|
||||
)
|
||||
|
||||
target_link_libraries(lwm2mclient_raw_block1 PRIVATE wakaama_static)
|
||||
|
||||
enable_testing()
|
||||
|
@ -32,3 +32,5 @@ target_sources(
|
||||
)
|
||||
|
||||
target_link_libraries(lwm2mclient_tinydtls PRIVATE wakaama_static)
|
||||
|
||||
enable_testing()
|
||||
|
@ -32,3 +32,5 @@ target_sources(
|
||||
)
|
||||
|
||||
target_link_libraries(lwm2mclient PRIVATE wakaama_static)
|
||||
|
||||
enable_testing()
|
||||
|
@ -14,3 +14,5 @@ add_subdirectory(../../ wakaama_lib)
|
||||
add_executable(lightclient)
|
||||
target_sources(lightclient PRIVATE lightclient.c object_device.c object_security.c object_server.c object_test.c)
|
||||
target_link_libraries(lightclient PRIVATE wakaama_static)
|
||||
|
||||
enable_testing()
|
||||
|
@ -13,3 +13,5 @@ add_subdirectory(../../ wakaama_lib)
|
||||
add_executable(lwm2mserver)
|
||||
target_sources(lwm2mserver PRIVATE lwm2mserver.c)
|
||||
target_link_libraries(lwm2mserver PRIVATE wakaama_static)
|
||||
|
||||
enable_testing()
|
||||
|
Loading…
x
Reference in New Issue
Block a user