Skip to content

Commit

Permalink
ci: pass NCS version string
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Nov 29, 2023
1 parent 0406c34 commit fc88f47
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ permissions:
env:
BUILD_IMAGE_NAME: hello-nrfcloud-firmware
TWISTER_IMAGE_NAME: hello-nrfcloud-firmware-twister
NCS_VERSION: v2.5.0

jobs:
# generate date string to be embedded in builds
Expand Down Expand Up @@ -88,7 +89,10 @@ jobs:

- name: Build Docker
if: steps.check-docker-image.outcome == 'failure'
run: docker buildx build -t $BUILD_IMAGE_NAME .
run: |
docker buildx build \
--build-arg NCS_VERSION=${{ env.NCS_VERSION }} \
-t $BUILD_IMAGE_NAME .
- name: Publish Docker image
if: steps.check-docker-image.outcome == 'failure'
Expand Down Expand Up @@ -270,20 +274,13 @@ jobs:
# }

- run: |
pwd
ls -la
printenv
- name: Build firmware
working-directory: project/asset_tracker_v2
run: |
nrfutil toolchain-manager launch /bin/bash -- -c '\
west build -b ${{ env.BOARD }} \
-p always -- \
${{ env.EXTRA_ARGS }} \
-DOVERLAY_CONFIG="${{ env.CONFIG_OVERLAY }};${{ env.MEMFAULT_OVERLAY }};${{ env.BSEC_OVERLAY }};firmware.conf" \
'
west build -b ${{ env.BOARD }} \
-p always -- \
${{ env.EXTRA_ARGS }} \
-DOVERLAY_CONFIG="${{ env.CONFIG_OVERLAY }};${{ env.MEMFAULT_OVERLAY }};${{ env.BSEC_OVERLAY }};firmware.conf"
- name: Upload symbols file to Memfault
continue-on-error: true
Expand Down
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ RUN <<EOT
apt-get -y install wget unzip
EOT

# Install Memfault CLI
RUN apt-get -y install python3-pip && pip3 install memfault-cli

# Install toolchain
# Make nrfutil install in a shared location, because when used with GitHub
# Actions, the image will be launched with the home dir mounted from the local
# checkout.
ENV NRFUTIL_HOME=/usr/local/share/nrfutil
# Install toolchain
RUN <<EOT
wget -q https://developer.nordicsemi.com/.pc-tools/nrfutil/x64-linux/nrfutil
mv nrfutil /usr/local/bin
Expand All @@ -30,11 +32,7 @@ EOT
# Prepare image with a ready to use build environment
ADD . /workdir
WORKDIR /workdir
SHELL ["nrfutil","toolchain-manager","launch","/bin/bash","--","-c"]
SHELL ["nrfutil","toolchain-manager","launch","/bin/bash","-euxo","pipefail","--","-c"]
RUN <<EOT
west init -l . && west update --narrow -o=--depth=1
EOT

# Install Memfault CLI
SHELL ["/bin/sh", "-c"]
RUN apt-get -y install python3-pip && pip3 install memfault-cli

0 comments on commit fc88f47

Please sign in to comment.