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 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: |