mirror of
https://github.com/solokeys/solo2.git
synced 2026-06-20 13:16:13 -07:00
153 lines
4.7 KiB
YAML
153 lines
4.7 KiB
YAML
name: ci
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- dev
|
|
- main
|
|
|
|
env:
|
|
CARGO_INCREMENTAL: 0
|
|
# do not set RUSTFLAGES, would overrides .cargo/config (linker script, flip-link)
|
|
|
|
jobs:
|
|
build-lpc55:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
board:
|
|
- board-lpcxpresso55
|
|
- board-solo2
|
|
# - board-okdoe1
|
|
rust:
|
|
- "1.94"
|
|
defaults:
|
|
run:
|
|
working-directory: runners/lpc55
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Install littlefs2-sys/micro-ecc-sys build dependencies
|
|
shell: bash
|
|
run: |
|
|
apt-get update && apt-get install sudo
|
|
env && pwd && sudo apt-get update -y -qq && sudo apt-get install -y -qq llvm libc6-dev-i386 libclang-dev clang git
|
|
- uses: fiam/arm-none-eabi-gcc@v1.0.4
|
|
with:
|
|
release: "9-2020-q2"
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: ${{ matrix.rust }}
|
|
target: thumbv8m.main-none-eabi
|
|
override: true
|
|
components: llvm-tools-preview
|
|
# Use precompiled binutils
|
|
- name: cargo install cargo-binutils
|
|
uses: actions-rs/install@v0.1
|
|
with:
|
|
crate: cargo-binutils
|
|
version: latest
|
|
use-tool-cache: true
|
|
- name: cargo install flip-link
|
|
uses: actions-rs/install@v0.1
|
|
with:
|
|
crate: flip-link
|
|
version: latest
|
|
use-tool-cache: true
|
|
- name: Build
|
|
run: |
|
|
cargo build --release --features ${{ matrix.board }}
|
|
- name: Size
|
|
run: |
|
|
cargo size --release --features ${{ matrix.board }}
|
|
- name: Artifacts for firmware bundle
|
|
run: |
|
|
cargo objcopy --release --features ${{ matrix.board }} -- -O binary firmware-${{ matrix.board }}.bin
|
|
sudo cp *.bin /
|
|
- name: Upload Firmware
|
|
uses: actions/upload-artifact@v4
|
|
continue-on-error: true
|
|
with:
|
|
name: Firmware
|
|
path: runners/lpc55/target/thumbv8m.main-none-eabi/release/runner
|
|
- name: Build Provisioner
|
|
run: |
|
|
cargo build --release --features ${{ matrix.board }},provisioner-app,admin-app,provisioner-app/test-attestation
|
|
- name: Upload Provisioner
|
|
uses: actions/upload-artifact@v4
|
|
continue-on-error: true
|
|
with:
|
|
name: Provisioner
|
|
path: runners/lpc55/target/thumbv8m.main-none-eabi/release/runner
|
|
|
|
|
|
build-pc:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
# TODO: some build issue currently
|
|
# - macos-latest
|
|
rust:
|
|
- "1.94"
|
|
defaults:
|
|
run:
|
|
working-directory: runners/pc
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Install Linux build dependencies
|
|
if: matrix.os == 'ubuntu-latest'
|
|
shell: bash
|
|
run: |
|
|
apt-get update && apt-get install sudo
|
|
sudo apt update -y -qq && sudo apt install -y -qq llvm libclang-dev build-essential clang
|
|
|
|
# this is already installed
|
|
# - name: Install macOS build dependencies
|
|
# if: matrix.os == 'macos-latest'
|
|
# shell: bash
|
|
# run: brew install llvm
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: ${{ matrix.rust }}
|
|
override: true
|
|
- name: Build
|
|
run: cargo build --release
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Install Linux build dependencies
|
|
shell: bash
|
|
run: |
|
|
apt-get update && apt-get install sudo
|
|
sudo apt update -y -qq && sudo apt install -y -qq llvm libc6-dev-i386 libclang-dev build-essential clang
|
|
- uses: fiam/arm-none-eabi-gcc@v1.0.4
|
|
with:
|
|
release: "9-2020-q2"
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: "1.94"
|
|
target: thumbv8m.main-none-eabi
|
|
override: true
|
|
components: rustfmt, clippy
|
|
- name: cargo fmt --check
|
|
run: cargo fmt --all --check
|
|
- name: cargo clippy (host)
|
|
run: cargo clippy --all-targets -- -D warnings
|
|
- name: cargo clippy (lpc55, board-lpcxpresso55)
|
|
working-directory: runners/lpc55
|
|
run: cargo clippy --release --features board-lpcxpresso55
|
|
- name: cargo clippy (lpc55, board-solo2)
|
|
working-directory: runners/lpc55
|
|
run: cargo clippy --release --features board-solo2
|
|
- name: cargo clippy (lpc55, provisioner)
|
|
working-directory: runners/lpc55
|
|
run: cargo clippy --release --features board-lpcxpresso55,provisioner-app,admin-app,provisioner-app/test-attestation
|