diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb0dc21..af53072 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,29 +6,35 @@ on: schedule: - cron: "0 0 * * *" +permissions: + contents: read + jobs: build: + name: Build app and tests strategy: fail-fast: false matrix: - os: [ubuntu-22.04, macos-13, macos-14, windows-2022] + os: [ubuntu-22.04, macos-14, macos-15-intel, windows-2022] runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v4 with: path: example-application + persist-credentials: false - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.11 + python-version: 3.12 - name: Setup Zephyr project uses: zephyrproject-rtos/action-zephyr-setup@v1 with: app-path: example-application toolchains: arm-zephyr-eabi + ccache-cache-key: ${{ matrix.os }} - name: Build firmware working-directory: example-application diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 54f7b64..c261fcc 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,18 +5,25 @@ name: Documentation on: [push, pull_request] -env: - DOXYGEN_VERSION: 1.9.6 +permissions: + contents: read jobs: build: + name: Build runs-on: ubuntu-22.04 + strategy: + matrix: + doxygen-version: [1.9.6, 1.14.0] steps: - name: Checkout uses: actions/checkout@v4 + with: + persist-credentials: false - name: Install dependencies run: | + DOXYGEN_VERSION="${{ matrix.doxygen-version }}" wget --no-verbose "https://github.com/doxygen/doxygen/releases/download/Release_${DOXYGEN_VERSION//./_}/doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz" tar xf doxygen-${DOXYGEN_VERSION}.linux.bin.tar.gz echo "${PWD}/doxygen-${DOXYGEN_VERSION}/bin" >> $GITHUB_PATH @@ -34,11 +41,11 @@ jobs: mv _build_sphinx/html/* deploy - name: Setup pages - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' && matrix.doxygen-version == '1.14.0' uses: actions/configure-pages@v4 - name: Upload pages artifact - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' && matrix.doxygen-version == '1.14.0' uses: actions/upload-pages-artifact@v3 with: path: doc/deploy @@ -47,9 +54,11 @@ jobs: if: github.event_name == 'pull_request' uses: actions/upload-artifact@v4 with: + name: docs-doxygen-${{ matrix.doxygen-version }} path: doc/deploy deploy: + name: Deploy runs-on: ubuntu-22.04 needs: build if: github.event_name != 'pull_request' diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index a59bf06..01ecff8 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -10,3 +10,28 @@ find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(app LANGUAGES C) target_sources(app PRIVATE src/main.c) + +# The code below locates the git index file for this repository and adds it as a dependency for +# the application VERSION file so that if the repo has a new commit added, even if no files in +# the build have changed, the application version file will be regenerated with the new git commit +find_package(Git QUIET) +if(GIT_FOUND) + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --absolute-git-dir + WORKING_DIRECTORY . + OUTPUT_VARIABLE application_git_dir + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE stderr + RESULT_VARIABLE return_code + ) + # If there is an error e.g. it is not a git repo, we just silently ignore it and continue + # without a dependency, this will be the case with freestanding applications. + if(NOT return_code) + if(NOT "${stderr}" STREQUAL "") + message(WARNING "Application build version git rev-parse warned: ${stderr}") + endif() + + set_property(TARGET app_version_h PROPERTY APP_VERSION_DEPENDS ${application_git_dir}/index) + endif() +endif() diff --git a/boards/vendor/custom_plank/board.yml b/boards/vendor/custom_plank/board.yml index fde81e2..672e1fe 100644 --- a/boards/vendor/custom_plank/board.yml +++ b/boards/vendor/custom_plank/board.yml @@ -3,6 +3,7 @@ board: name: custom_plank + full_name: Custom Plank vendor: vendor socs: - name: nrf52840 diff --git a/doc/Doxyfile b/doc/Doxyfile index 2c744db..86ae4bf 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -1090,7 +1090,7 @@ FILTER_SOURCE_PATTERNS = # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = main.md +USE_MDFILE_AS_MAINPAGE = _doxygen/main.md # The Fortran standard specifies that for fixed formatted Fortran code all # characters from position 72 are to be considered as comment. A common diff --git a/scripts/example_west_command.py b/scripts/example_west_command.py index 7f68d7f..b64cc71 100644 --- a/scripts/example_west_command.py +++ b/scripts/example_west_command.py @@ -7,7 +7,6 @@ Example of a west extension in the example-application repository.''' from west.commands import WestCommand # your extension must subclass this -from west import log # use this for user output class ExampleWestCommand(WestCommand): @@ -45,5 +44,5 @@ def do_run(self, args, unknown_args): # $ west my-command-name -o FOO BAR # --optional is FOO # required is BAR - log.inf('--optional is', args.optional) - log.inf('required is', args.required) + self.inf('--optional is', args.optional) + self.inf('required is', args.required) diff --git a/west.yml b/west.yml index d325288..2e11f74 100644 --- a/west.yml +++ b/west.yml @@ -12,11 +12,11 @@ manifest: projects: - name: zephyr remote: zephyrproject-rtos - revision: v4.1.0 + revision: v4.4.0 import: # By using name-allowlist we can clone only the modules that are # strictly needed by the application. name-allowlist: - - cmsis # required by the ARM port + - cmsis_6 # required by the ARM port for Cortex-M - hal_nordic # required by the custom_plank board (Nordic based) - hal_stm32 # required by the nucleo_f302r8 board (STM32 based)