Skip to content

Commit 253b99f

Browse files
committed
Merge remote-tracking branch 'origin/default' into test/bacnet-settings-functional
2 parents 5ab5c21 + 3d1c8ce commit 253b99f

7 files changed

Lines changed: 62 additions & 17 deletions

File tree

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Set update schedule for GitHub Actions
2+
3+
version: 2
4+
updates:
5+
- package-ecosystem: "" # See documentation for possible values
6+
directory: "/" # Location of package manifests
7+
schedule:
8+
interval: "weekly"

.github/workflows/zephyr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ jobs:
3636
- uses: actions/checkout@v3
3737
- name: Run Docker image from GHCR
3838
env:
39-
DOCKER_RUN_TARGET: "/bacnet/west-ci.sh && /bacnet/samples.sh && /bacnet/unittest.sh"
39+
DOCKER_RUN_TARGET: "/workspace/bacnet/west-ci.sh && /workspace/bacnet/samples.sh && /workspace/bacnet/unittest.sh"
4040
ZEPHYR_CONTAINER: "ghcr.io/zephyrproject-rtos/ci:v0.26-branch"
4141
run: |
4242
ls -alh
4343
echo "== Run Docker image from GHCR"
44-
docker run --rm -v "$(pwd):/bacnet" "$ZEPHYR_CONTAINER" /bin/bash -c "$DOCKER_RUN_TARGET"
44+
docker run --rm -w /workspace -v "$(pwd):/workspace/bacnet" "$ZEPHYR_CONTAINER" /bin/bash -c "$DOCKER_RUN_TARGET"
4545
- name: Upload sample Twister results
4646
if: ${{ always() }}
4747
uses: actions/upload-artifact@v4

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ The git repository is hosted at the following site:
1919
and placed them into BACnet Protocol Stack library.
2020

2121
### Fixed
22+
* Fixed pipeline unit test and samples build by adding shed_level and
23+
timer_value source files to various CMakeLists. Also fixed the
24+
workspace path in the Docker container for building and save
25+
the build logs as artifacts for debugging failures. (#61)
2226
* Fixed bacnet shell property value JSON for empty arrays and lists. (#55)
2327
* Fixed bacnet shell property value JSON for arrays and lists. (#54)
2428
* Fixed missing config defines. Added Loop object and MAX_APDU

samples.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
#!/bin/bash
2+
# Set the path to the twister executable
3+
TWISTER_EXE=""
24

5+
# Set workspace virtual environment if available
36
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
7+
WORKSPACE_VENV="$SCRIPT_DIR/../.venv"
48
WORKSPACE_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
5-
6-
# Set the path to the twister executable
79
TWISTER_EXE="$WORKSPACE_DIR/zephyr/scripts/twister"
810

11+
if [ -x "$WORKSPACE_VENV/bin/python3" ]; then
12+
VENV_SITE="$($WORKSPACE_VENV/bin/python3 -c 'import site; print(site.getsitepackages()[0])')"
13+
export PATH="$WORKSPACE_VENV/bin:$PATH"
14+
export PYTHONPATH="$VENV_SITE${PYTHONPATH:+:$PYTHONPATH}"
15+
fi
16+
917
# Set the path to the test cases directory
1018
TEST_CASES_DIR="$SCRIPT_DIR/zephyr/samples"
1119

@@ -45,12 +53,12 @@ find "$OUTPUT_DIR" -name 'app' -exec rm -rf \
4553
{}/../cmake_install.cmake
4654
{}/../CMakeCache.txt' \; 2>/dev/null
4755
find "$OUTPUT_DIR" -name 'app' -exec rm -rf '{}' \; 2>/dev/null
48-
echo "Twister output cleanup completed successfully."
56+
echo "Twister samples output cleanup completed successfully."
4957

5058
# Check if twister ran successfully
5159
if [ $? -eq 0 ]; then
52-
echo "Twister testing completed successfully."
60+
echo "Twister samples testing completed successfully."
5361
else
54-
echo "Twister testing failed."
62+
echo "Twister samples testing failed."
5563
exit 1
5664
fi

unittest.sh

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/bash
2-
32
# Set the path to the twister executable
43
TWISTER_EXE=""
54

@@ -17,12 +16,11 @@ fi
1716

1817
# Set the path to the test cases directory
1918
TEST_CASES_DIR="$SCRIPT_DIR/zephyr/tests"
20-
NATIVE_SIM_TEST_CASES_DIR="$SCRIPT_DIR/zephyr/tests/subsys/bacnet_settings"
2119

2220
# Set the output directory for test results
2321
OUTPUT_DIR="$SCRIPT_DIR/twister-out.unit_testing"
24-
NATIVE_SIM_OUTPUT_DIR="$SCRIPT_DIR/twister-out.native_sim"
2522

23+
# Set platform to unit testing to avoid building for ALL platforms
2624
TWISTER_PLATFORM="unit_testing"
2725
NATIVE_SIM_PLATFORM="native_sim"
2826

@@ -70,14 +68,38 @@ UNIT_TEST_RC=$?
7068
NATIVE_SIM_RC=$?
7169

7270
# twister output directory cleanup files we do not archive
73-
cleanup_twister_output_dir "$OUTPUT_DIR"
74-
cleanup_twister_output_dir "$NATIVE_SIM_OUTPUT_DIR"
75-
echo "Twister output cleanup completed successfully."
71+
find "$OUTPUT_DIR" -name 'CMakeFiles' -exec rm -rf {} \; 2>/dev/null
72+
find "$OUTPUT_DIR" -name 'modules' -exec rm -rf {} \; 2>/dev/null
73+
find "$OUTPUT_DIR" -name 'app' -exec rm -rf \
74+
'{}/../zephyr/arch
75+
{}/../zephyr/boards
76+
{}/../zephyr/cmake
77+
{}/../zephyr/CMakeFiles
78+
{}/../zephyr/dev_graph.dot
79+
{}/../zephyr/drivers
80+
{}/../zephyr/dts.cmake
81+
{}/../zephyr/edt.pickle
82+
{}/../zephyr/include
83+
{}/../zephyr/isrList.bin
84+
{}/../zephyr/kconfig
85+
{}/../zephyr/kernel
86+
{}/../zephyr/lib
87+
{}/../zephyr/libzephyr.a
88+
{}/../zephyr/misc
89+
{}/../zephyr/modules
90+
{}/../zephyr/soc
91+
{}/../zephyr/subsys
92+
{}/../Makefile
93+
{}/../Kconfig
94+
{}/../cmake_install.cmake
95+
{}/../CMakeCache.txt' \; 2>/dev/null
96+
find "$OUTPUT_DIR" -name 'app' -exec rm -rf '{}' \; 2>/dev/null
97+
echo "Twister unit_testing output cleanup completed successfully."
7698

7799
# Check if twister ran successfully
78-
if [ $UNIT_TEST_RC -eq 0 ] && [ $NATIVE_SIM_RC -eq 0 ]; then
79-
echo "Twister testing completed successfully."
100+
if [ $? -eq 0 ]; then
101+
echo "Twister unit_testing completed successfully."
80102
else
81-
echo "Twister testing failed."
103+
echo "Twister unit_testing failed."
82104
exit 1
83105
fi

west-ci.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/bash
2+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
3+
WORKSPACE_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
24

35
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
46
WORKSPACE_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
@@ -9,5 +11,5 @@ cd "$WORKSPACE_DIR"
911
echo "$PWD"
1012
ls -al "$SCRIPT_DIR"
1113
west --version
12-
west init -l --mf "$SCRIPT_DIR/west-ci.yml" .
14+
west init -l --mf west-ci.yml "$SCRIPT_DIR"
1315
west update > /dev/null 2>&1

zephyr/tests/bacnet/bacdcode/testcase.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
tests:
22
bacnet.bacdcode.unit:
3+
skip: true # TODO: Remove once unit test builds/runs under Zephyr CI
34
tags: bacnet
45
type: unit
56
bacnet.bacdcode:

0 commit comments

Comments
 (0)