|
| 1 | +name: Build Zephyr OpenThread RCP (USB) for nRF52840 dongles |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - build-* |
| 8 | + pull_request: |
| 9 | + branches: [ main ] |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +jobs: |
| 13 | + build-rcp-usb: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + include: |
| 19 | + - id: nrf52840dongle |
| 20 | + board: nrf52840dongle/nrf52840 |
| 21 | + - id: nrf52840_mdk_usb_dongle |
| 22 | + board: nrf52840_mdk_usb_dongle/nrf52840 |
| 23 | + - id: raytac_mdbt50q_cx_40_dongle |
| 24 | + board: raytac_mdbt50q_cx_40_dongle/nrf52840 |
| 25 | + |
| 26 | + steps: |
| 27 | + - name: Checkout repository |
| 28 | + uses: actions/checkout@v4 |
| 29 | + |
| 30 | + - name: Set up Python |
| 31 | + uses: actions/setup-python@v5 |
| 32 | + with: |
| 33 | + python-version: "3.12" |
| 34 | + |
| 35 | + - name: Install host dependencies |
| 36 | + run: | |
| 37 | + sudo apt-get update |
| 38 | + sudo apt-get install -y \ |
| 39 | + cmake ninja-build gperf device-tree-compiler \ |
| 40 | + dfu-util git wget xz-utils file \ |
| 41 | + python3-pip python3-venv |
| 42 | +
|
| 43 | + - name: Create west manifest (pinned Zephyr) |
| 44 | + run: | |
| 45 | + mkdir -p zephyr-app |
| 46 | + cat > zephyr-app/west.yml << 'EOF' |
| 47 | + manifest: |
| 48 | + version: "0.12" |
| 49 | + remotes: |
| 50 | + - name: zephyrproject-rtos |
| 51 | + url-base: https://github.com/zephyrproject-rtos |
| 52 | + projects: |
| 53 | + - name: zephyr |
| 54 | + remote: zephyrproject-rtos |
| 55 | + revision: v4.3.0 |
| 56 | + import: true |
| 57 | + self: |
| 58 | + path: zephyr-app |
| 59 | + EOF |
| 60 | +
|
| 61 | + - name: Setup Zephyr (west + Zephyr SDK) |
| 62 | + uses: zephyrproject-rtos/action-zephyr-setup@v1 |
| 63 | + with: |
| 64 | + app-path: zephyr-app |
| 65 | + toolchains: arm-zephyr-eabi |
| 66 | + sdk-version: 0.17.4 |
| 67 | + |
| 68 | + - name: Build RCP over USB (${{ matrix.id }}) |
| 69 | + run: | |
| 70 | + west build -p always \ |
| 71 | + -b "${{ matrix.board }}" \ |
| 72 | + -d "build/${{ matrix.id }}" \ |
| 73 | + zephyr/samples/net/openthread/coprocessor \ |
| 74 | + -- \ |
| 75 | + -DDTC_OVERLAY_FILE=usb.overlay \ |
| 76 | + -DEXTRA_CONF_FILE="overlay-rcp.conf;overlay-usb-nrf-br.conf" |
| 77 | +
|
| 78 | + - name: Collect artifacts |
| 79 | + run: | |
| 80 | + mkdir -p artifacts/${{ matrix.id }} |
| 81 | + cp -v build/${{ matrix.id }}/zephyr/zephyr.hex artifacts/${{ matrix.id }}/ot-rcp-USB.hex |
| 82 | + cp -v build/${{ matrix.id }}/zephyr/zephyr.elf artifacts/${{ matrix.id }}/ot-rcp-USB.elf || true |
| 83 | + cp -v build/${{ matrix.id }}/zephyr/.config artifacts/${{ matrix.id }}/zephyr.config || true |
| 84 | + cp -v build/${{ matrix.id }}/zephyr/zephyr.dts artifacts/${{ matrix.id }}/zephyr.dts || true |
| 85 | +
|
| 86 | + - name: Upload artifacts (${{ matrix.id }}) |
| 87 | + uses: actions/upload-artifact@v4 |
| 88 | + with: |
| 89 | + name: zephyr-ot-rcp-usb-${{ matrix.id }} |
| 90 | + path: artifacts/${{ matrix.id }} |
0 commit comments