Skip to content

added USB build to workflow #4

added USB build to workflow

added USB build to workflow #4

name: Build OpenThread nRF52840 Examples
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Build OpenThread nRF52840
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the code
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
# Step 2: Set up dependencies
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
gcc-arm-none-eabi \
make \
cmake \
git \
libstdc++-arm-none-eabi-newlib \
python3-pip
pip3 install --upgrade pip
pip3 install nrfutil
# Step 3: Bootstrap the project
- name: Bootstrap the project
working-directory: ot-nrf528xx
run: ./script/bootstrap
# Step 4: Build UART version
- name: Build nRF52840 UART Example
working-directory: ot-nrf528xx
run: ./script/build nrf52840 UART_trans
# Step 5: Rename UART ELF and HEX files
- name: Rename UART binaries
working-directory: ot-nrf528xx
run: |
mv build/bin/ot-cli-ftd build/bin/ot-cli-ftd-UART
arm-none-eabi-objcopy -O ihex build/bin/ot-cli-ftd-UART build/bin/ot-cli-ftd-UART.hex
# Step 6: Build USB version
- name: Build nRF52840 USB Example
working-directory: ot-nrf528xx
run: ./script/build nrf52840 USB_trans -DOT_BOOTLOADER=USB
# Step 7: Rename USB ELF and HEX files
- name: Rename USB binaries
working-directory: ot-nrf528xx
run: |
mv build/bin/ot-cli-ftd build/bin/ot-cli-ftd-USB
arm-none-eabi-objcopy -O ihex build/bin/ot-cli-ftd-USB build/bin/ot-cli-ftd-USB.hex
# Step 8: Upload artifacts
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: ot-nrf528xx-binaries
path: |
ot-nrf528xx/build/bin/ot-cli-ftd-UART
ot-nrf528xx/build/bin/ot-cli-ftd-UART.hex
ot-nrf528xx/build/bin/ot-cli-ftd-USB
ot-nrf528xx/build/bin/ot-cli-ftd-USB.hex