From 6ed9b10463aec35887fe434bc7201846994c4d96 Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Thu, 27 Mar 2025 15:19:41 -0400 Subject: [PATCH 1/2] action: support skipping dependencies for running in container Support skipping os dependencies within the action. This is useful when running in a container where these dependencies are present. Signed-off-by: Daniel DeGrasse --- action.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 8146798..27d6a39 100644 --- a/action.yml +++ b/action.yml @@ -34,6 +34,13 @@ inputs: required: false default: https://github.com/zephyrproject-rtos/sdk-ng/releases/download + skip-dependencies: + description: | + Set to 'true' to skip installation of SDK and OS dependencies. Useful + when running action within a container + required: false + default: 'false' + toolchains: description: List of toolchains to install, colon separated required: false @@ -53,6 +60,7 @@ runs: using: "composite" steps: - name: Install dependencies + if: ${{ inputs.skip-dependencies != 'true' }} shell: bash run: | if [ "${{ runner.os }}" = "Windows" ]; then @@ -163,13 +171,14 @@ runs: west packages pip --install --ignore-venv-check || pip3 install -r zephyr/scripts/requirements.txt - name: Cache Zephyr SDK + if: ${{ inputs.skip-dependencies != 'true' }} id: cache-toolchain uses: actions/cache@v4 with: path: ${{ inputs.base-path }}/zephyr-sdk key: ${{ env.SDK_FILE }}-${{ inputs.toolchains }} - - if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }} + - if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' && inputs.skip-dependencies != 'true' }} working-directory: ${{ inputs.base-path }} name: Download Zephyr SDK shell: bash @@ -184,6 +193,7 @@ runs: fi - name: Setup Zephyr SDK + if: ${{ inputs.skip-dependencies != 'true' }} working-directory: ${{ inputs.base-path }}/zephyr-sdk shell: bash run: | From 444fa0e11843928c37be71cf795b087037fc27f3 Mon Sep 17 00:00:00 2001 From: Daniel DeGrasse Date: Thu, 27 Mar 2025 15:22:26 -0400 Subject: [PATCH 2/2] readme: add example of skipping OS dependencies Add example of how to configure action to skip installing OS level dependencies and Zephyr SDK Signed-off-by: Daniel DeGrasse --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index a9da3c0..705b2ab 100644 --- a/README.md +++ b/README.md @@ -85,4 +85,15 @@ the necessary modules for a West based [Zephyr workspace application][1]. west-project-filter: -nrf_hw_models ``` +## Skip installing OS level dependencies and Zephyr SDK + +```yaml +- name: Setup Zephyr project + uses: zephyrproject-rtos/action-zephyr-setup@v1 + with: + app-path: example-application + toolchains: arm-zephyr-eabi + skip-dependencies: true +``` + [1]: https://docs.zephyrproject.org/latest/develop/application/index.html#zephyr-workspace-app