Skip to content

Upgrade packages to latest versions #333

Upgrade packages to latest versions

Upgrade packages to latest versions #333

Workflow file for this run

name: Firmware CI
on:
push:
branches:
- main
paths:
- .github/workflows/firmware-ci.yml
- firmware/**
- networking/firmware_protocol/**
pull_request:
paths:
- .github/workflows/firmware-ci.yml
- firmware/**
- networking/firmware_protocol/**
workflow_dispatch:
jobs:
fmt:
name: Format
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./firmware
steps:
- uses: actions/checkout@v3
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: "./firmware -> target/"
- name: Check formatting
run: cargo fmt --check --all
build:
name: Build
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.net == 'net-wifi' }} # Continue if wifi fails because it's not fully working currently
strategy:
matrix:
mcu: [mcu-esp32c3, mcu-esp32, mcu-nrf52840, mcu-nrf52832]
net: [net-stubbed, net-wifi, net-ble]
log: [log-rtt, log-usb-serial, log-uart]
include:
- mcu: mcu-esp32c3
target: riscv32imc-unknown-none-elf
- mcu: mcu-esp32
target: xtensa-esp32-none-elf
espname: esp32 # needed for passing to xtensa action
- mcu: mcu-nrf52840
target: thumbv7em-none-eabihf
boot: nrf-boot-s140
- mcu: mcu-nrf52832
target: thumbv7em-none-eabihf
boot: nrf-boot-s132
exclude:
- mcu: mcu-esp32
log: log-usb-serial
- mcu: mcu-esp32
log: log-rtt
- mcu: mcu-nrf52832
log: log-usb-serial
- mcu: mcu-nrf52840
net: net-wifi
- mcu: mcu-nrf52832
net: net-wifi
- mcu: mcu-nrf52840
net: net-ble
- mcu: mcu-nrf52832
net: net-ble
env:
FEATURES: ${{ format('{0},{1},{2},{3},imu-stubbed,fusion-stubbed', matrix.mcu, matrix.net, matrix.log, matrix.boot) }}
defaults:
run:
working-directory: ./firmware
steps:
- uses: actions/checkout@v3
- name: Use .env.template as .env
run: |
cp .env.template .env
- name: Install Xtensa toolchain
if: startsWith(matrix.target, 'xtensa')
uses: esp-rs/xtensa-toolchain@v1.3
with:
ldproxy: false
buildtargets: ${{ matrix.espname }}
- if: startsWith(matrix.target, 'xtensa')
run: rustup override set esp
- name: Cache cargo dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: "./firmware -> target/"
env-vars: "FEATURES"
cache-on-failure: ${{ matrix.net == 'net-wifi' }} # Again, wifi doesnt fully work currently.
- uses: taiki-e/install-action@v1
with:
tool: clippy-sarif,sarif-fmt
- name: Clippy lints
run: |
cargo clippy --target ${{ matrix.target }} --no-default-features --features $FEATURES --message-format=json |
clippy-sarif | tee results.sarif | sarif-fmt && sed -i 's/"uri": "/"uri": "firmware\//g' results.sarif
- name: Build
run: cargo build --target ${{ matrix.target }} --no-default-features --features $FEATURES
- name: Upload SARIF file
if: ${{ success() }}
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: firmware/results.sarif
category: ${{ env.FEATURES }}