nrfutil and Github actions

nrfutil is generally making command-line activities with NCS easier so I tried updating our Github actions scripts to take advantage

The following script downloads the tool, installs the required toolchain and launches a shell with the required alterations to the environment so that west works (e.g. adding ~/ncs/... elements to PATH

wget https://developer.nordicsemi.com/.pc-tools/nrfutil/x64-linux/nrfutil
mv nrfutil /usr/local/bin
chmod +x /usr/local/bin/nrfutil
nrfutil install toolchain-manager
echo "install v2.3.0 toolchain"
nrfutil toolchain-manager install --ncs-version v2.3.0
nrfutil toolchain-manager list
echo "before: $PATH"
nrfutil toolchain-manager launch /bin/bash
echo "after: $PATH"

However this doesn't apply when the script is run on GHA and west is unable to be found by following steps. All the steps up to `launch` appear to work as expected but launch does nothing?

github.com/.../nrfutil.yml

github.com/.../24593567398

Parents
  • Hello,

    I don't have experience with Github actions, but I suspect there may be some limitations when it comes to opening new shell. Instead of using the launch command, please try setting the env. variables in your current terminal by doing something like this:

    $ nrfutil toolchain-manager env --as-script > export_env.sh
    $ source export_env.sh

    Or

    $ source <(nrfutil toolchain-manager env --as-script)

    Best regards,

    Vidar

Reply
  • Hello,

    I don't have experience with Github actions, but I suspect there may be some limitations when it comes to opening new shell. Instead of using the launch command, please try setting the env. variables in your current terminal by doing something like this:

    $ nrfutil toolchain-manager env --as-script > export_env.sh
    $ source export_env.sh

    Or

    $ source <(nrfutil toolchain-manager env --as-script)

    Best regards,

    Vidar

Children
Related