Skip to content

Commit 1a9bc6c

Browse files
committed
github: Initial build workflow
Initial version of build workflow running twister building for PRs. Signed-off-by: Tommi Rantanen <tommi.rantanen@nordicsemi.no>
1 parent 86f2e2e commit 1a9bc6c

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Build and test app in toolchain bundle environment
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build-and-test-in-toolchain-bundle:
8+
runs-on: ubuntu-24.04
9+
steps:
10+
- name: Checkout repository with Serial Modem
11+
uses: actions/checkout@v4
12+
with:
13+
path: serial_modem
14+
15+
- name: Prepare west project
16+
run: |
17+
python3 -m pip install west
18+
west init -l serial_modem
19+
west update -o=--depth=1 -n
20+
21+
- name: Install nrfutil and toolchain manager
22+
run: |
23+
wget -q https://files.nordicsemi.com/artifactory/swtools/external/nrfutil/executables/x86_64-unknown-linux-gnu/nrfutil
24+
chmod +x nrfutil
25+
./nrfutil install toolchain-manager
26+
27+
- name: Find proper toolchain bundle
28+
id: set-tb-id
29+
run: echo "TOOLCHAIN_BUNDLE_NAME=ncs-toolchain-x86_64-linux-$(./nrf/scripts/print_toolchain_checksum.sh).tar.gz" >> $GITHUB_OUTPUT
30+
31+
- name: Restore toolchain bundle from cache
32+
id: restore-cached-tb
33+
uses: actions/cache/restore@v4
34+
with:
35+
path: ${{steps.set-tb-id.outputs.TOOLCHAIN_BUNDLE_NAME}}
36+
key: ${{steps.set-tb-id.outputs.TOOLCHAIN_BUNDLE_NAME}}
37+
38+
- name: Download toolchain bundle if not cached
39+
if: steps.restore-cached-tb.outputs.cache-hit != 'true'
40+
run: wget https://files.nordicsemi.com/artifactory/NCS/external/bundles/v3/${{steps.set-tb-id.outputs.TOOLCHAIN_BUNDLE_NAME}}
41+
42+
- name: Save toolchain bundle to cache
43+
if: steps.restore-cached-tb.outputs.cache-hit != 'true'
44+
uses: actions/cache/save@v4
45+
with:
46+
path: ${{steps.set-tb-id.outputs.TOOLCHAIN_BUNDLE_NAME}}
47+
key: ${{steps.set-tb-id.outputs.TOOLCHAIN_BUNDLE_NAME}}
48+
49+
- name: Install proper toolchain bundle
50+
run: ./nrfutil toolchain-manager install --toolchain-bundle ${{steps.set-tb-id.outputs.TOOLCHAIN_BUNDLE_NAME}}
51+
52+
- name: Build firmware
53+
run: |
54+
./nrfutil toolchain-manager launch --chdir serial_modem -- west twister -T app -v --inline-logs --build-only
55+
56+
# - name: Store hex files
57+
# uses: actions/upload-artifact@v4
58+
# with:
59+
# name: built-applications
60+
# path: serial_modem/twister-out/**/zephyr/zephyr.hex

0 commit comments

Comments
 (0)