diff --git a/.github/workflows/zephyr-samples.yml b/.github/workflows/zephyr-samples.yml deleted file mode 100644 index 407f0e6..0000000 --- a/.github/workflows/zephyr-samples.yml +++ /dev/null @@ -1,41 +0,0 @@ -permissions: - contents: read -name: Zephyr OS Samples -# For Zephyr 3.7 LTS, use the v0.26-branch -# or the latest v0.26.x release Docker image. -# Docker image was built on Ubuntu 22.04 -on: - push: - branches: [ "default" ] - pull_request: - branches: - - '*' - workflow_dispatch: - -jobs: - test: - name: Twister Samples - runs-on: ubuntu-22.04 - container: ghcr.io/zephyrproject-rtos/ci:v0.26-branch - env: - CMAKE_PREFIX_PATH: /opt/toolchains - steps: - - name: Clean /tmp - run: | - df -h - sudo rm -rf /tmp/* - df -h - - name: Checkout - uses: actions/checkout@v4 - with: - path: bacnet - - name: Initialize - working-directory: bacnet - run: | - west init -l . - west update - - name: Twister Tests samples - working-directory: bacnet - run: | - pwd - ./samples.sh diff --git a/.github/workflows/zephyr.yml b/.github/workflows/zephyr.yml index bfc2c81..fccbb3c 100644 --- a/.github/workflows/zephyr.yml +++ b/.github/workflows/zephyr.yml @@ -1,6 +1,6 @@ permissions: contents: read -name: Zephyr OS Tests +name: Zephyr OS Unit Tests and Sample Builds # For Zephyr 3.7 LTS, use the v0.26-branch # or the latest v0.26.x release Docker image. # Docker image was built on Ubuntu 22.04 @@ -13,24 +13,32 @@ on: workflow_dispatch: jobs: - test: - name: Twister Tests + run-image: runs-on: ubuntu-22.04 - container: ghcr.io/zephyrproject-rtos/ci:v0.26-branch - env: - CMAKE_PREFIX_PATH: /opt/toolchains + permissions: + packages: read # Required to pull private images from GHCR steps: - - name: Checkout - uses: actions/checkout@v4 - with: - path: bacnet - - name: Initialize - working-directory: bacnet + - name: Show File System Info run: | - west init -l . - west update - - name: Twister Tests unit_testing - working-directory: bacnet + docker system df + docker images + - name: Free file system space run: | - pwd - ./unittest.sh + echo "== Remove all unused containers, networks, images" + echo "== (both dangling and unused), and optionally, volumes." + set -e + sudo docker system prune --all --filter "until=720h" --force + docker system df + - name: Delete unnecessary tools folder + run: rm -rf /opt/hostedtoolcache + - name: Pull Docker image from GHCR + run: docker pull ghcr.io/zephyrproject-rtos/ci:v0.26-branch + - uses: actions/checkout@v3 + - name: Run Docker image from GHCR + env: + DOCKER_RUN_TARGET: "/bacnet/west-ci.sh && /bacnet/samples.sh && /bacnet/unittest.sh" + ZEPHYR_CONTAINER: "ghcr.io/zephyrproject-rtos/ci:v0.26-branch" + run: | + ls -alh + echo "== Run Docker image from GHCR" + docker run --rm -v "$(pwd):/bacnet" "$ZEPHYR_CONTAINER" /bin/bash -c "$DOCKER_RUN_TARGET" diff --git a/README.md b/README.md index 696b2ab..e4ca9df 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,7 @@ This integration uses automated continuous integration services to assist in automated compilation, validation, linting, security scanning, and unit testing to produce robust C code. -[![Actions Status](https://github.com/bacnet-stack/bacnet-stack-zephyr/actions/workflows/zephyr.yml/badge.svg)](https://github.com/bacnet-stack/bacnet-stack-zephyr/actions/workflows/zephyr.yml) GitHub Workflow: BACnet Stack Zephyr Twister Unit Tests - -[![Actions Status](https://github.com/bacnet-stack/bacnet-stack-zephyr/actions/workflows/zephyr-samples.yml/badge.svg)](https://github.com/bacnet-stack/bacnet-stack-zephyr/actions/workflows/zephyr-samples.yml) GitHub Workflow: BACnet Stack Samples Built +[![Actions Status](https://github.com/bacnet-stack/bacnet-stack-zephyr/actions/workflows/zephyr.yml/badge.svg)](https://github.com/bacnet-stack/bacnet-stack-zephyr/actions/workflows/zephyr.yml) GitHub Workflow: BACnet Stack Zephyr Twister Unit Tests and Sample Build [![Actions Status](https://github.com/bacnet-stack/bacnet-stack-zephyr/workflows/CodeQL/badge.svg)](https://github.com/bacnet-stack-zephyr/bacnet-stack/actions/workflows/codeql-analysis.yml) GitHub Workflow: CodeQL Analysis diff --git a/samples.sh b/samples.sh index d426137..faefdff 100755 --- a/samples.sh +++ b/samples.sh @@ -4,7 +4,7 @@ TWISTER_EXE="../zephyr/scripts/twister" # Set the path to the test cases directory -TEST_CASES_DIR="zephyr/samples" +TEST_CASES_DIR="../bacnet/zephyr/samples" # Set the output directory for test results OUTPUT_DIR="twister-out.samples" diff --git a/unittest.sh b/unittest.sh index 074ecc6..1aafdf6 100755 --- a/unittest.sh +++ b/unittest.sh @@ -4,7 +4,7 @@ TWISTER_EXE="../zephyr/scripts/twister" # Set the path to the test cases directory -TEST_CASES_DIR="zephyr/tests" +TEST_CASES_DIR="../bacnet/zephyr/tests" # Set the output directory for test results OUTPUT_DIR="twister-out.unit_testing" diff --git a/west-ci.sh b/west-ci.sh new file mode 100755 index 0000000..193a368 --- /dev/null +++ b/west-ci.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# setup our build environment +echo "$PWD" +ls -al bacnet +west --version +west init -l --mf bacnet/west-ci.yml . +west update > /dev/null 2>&1 diff --git a/west-ci.yml b/west-ci.yml new file mode 100644 index 0000000..0805ade --- /dev/null +++ b/west-ci.yml @@ -0,0 +1,51 @@ +# The default west manifest file for the bacnet-stack zephyr project. +# +# The per-installation west configuration file, .west/config, sets the +# path to the project containing this file in the [manifest] section's +# "path" variable. +# +# This imports the latest upstream Zephyr manifest file. +# +# You can pass your manifest repositories to west init when creating a +# new Zephyr installation. See the west documentation for more +# information. +# +# Beginning with west 0.8, the following command-line options +# can be used to initialize with a repository lacking a west.yml +# file at the top level. +# +# west init +# -m +# --mr +# --mf +# + +manifest: + version: 1.2 + + remotes: + - name: bacnet-stack + url-base: https://github.com/bacnet-stack + - name: zephyrproject-rtos + url-base: https://github.com/zephyrproject-rtos + + defaults: + remote: bacnet-stack + + self: + path: bacnet + + projects: + - name: bacnet-stack + path: bacnet/stack # Hidden by bacnet/.gitignore + revision: master + - name: zephyr + path: zephyr + revision: v3.7.1 + remote: zephyrproject-rtos + west-commands: scripts/west-commands.yml + import: + name-allowlist: + - cmsis + - picolibc + - hal_stm32