Skip to content

Conversation

@jonathansmithinfact
Copy link

Hi!

This is an awesome project, has been very useful!

This PR adds support for sdk version v3.0.2 and allows you to select building with sysbuild with a flag. If the flag is not used it should default to building without sysbuild as previous.

I have only tested with sysbuild as this is what my project uses, I have not tested without sysbuild.

You should be able to test these changes by referencing my fork:
https://github.com/jonathansmithinfact/nrf-connect-sdk-ci/releases/tag/v3.0.2

@SergeyLadanov
Copy link
Contributor

Hi, @jonathansmithinfact!
Thank you very much for the contribution and for the kind words about the project — I really appreciate it!
I reviewed the changes, and I agree that having control over sysbuild is useful. However, the current implementation hard-codes the build command inside the entrypoint script, which makes the docker image less flexible for other users.

Instead of branching inside entrypoint.sh, I would prefer to keep the script generic and continue forwarding all arguments to west. My plan is to replace (in etrypoint.sh):

exec "$@"

with:

exec bash -c "$@"

And add new parameter (add_flags) in action.yml:

...
inputs:
  board:  # id of input
    description: 'Board for build'
    required: true
  build_dir:
    description: 'Building directory'
    required: true
    default: 'build'
  add_flags: # new parameter
    description: 'Additional flags'
    required: true
    default: '--no-sysbuild'
runs:
  using: 'docker'
  image: 'docker://sergeyladanov/nrf-connect-sdk:v3.0.2'
  args:
    - west 
    - build
    - --build-dir 
    - ${{ inputs.build_dir }}
    - .
    - --pristine
    - --board 
    - ${{ inputs.board }}
    - ${{ input.add_flags }} # using new parameter

This way each user can provide any additional flags they need (including --no-sysbuild, or anything else), without modifying the script. It keeps the Docker image and the action more universal.

Here are examples of the new usage:

Build with sysbuild (no additional flags):

- name: Build
  uses: embedd-actions/nrf-connect-sdk-ci@v3.0.2
  with:
    board: <DK Board Name>
    build_dir: build
    add_flags: ''   # do not pass "--no-sysbuild"

Build without sysbuild:

- name: Build
  uses: embedd-actions/nrf-connect-sdk-ci@v3.0.2
  with:
    board: <DK Board Name>
    build_dir: build
    add_flags: '--no-sysbuild'

This approach should cover your use-case and also give all users the freedom to pass any custom flags they need.

I’ve published a new release containing these changes (v3.0.2)

Thanks again for contributing!

@jonathansmithinfact
Copy link
Author

Hi @SergeyLadanov. That is a much more flexible solution and should work great for my use case.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants