Skip to content

Commit

Permalink
Set up CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrgn committed Dec 15, 2024
1 parent a2451d8 commit 3cc0865
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
push:
branches: [master, main]
pull_request:

name: CI

jobs:

firmware-build:
name: Build firmware
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2024-10-10
target: riscv32imc-unknown-none-elf
override: true
- name: Run check
env:
WIFI_SSID: "example-ssid"
WIFI_PASS: "example-pass"
SPACEAPI_SENSOR_ENDPOINT: "http://example.com/sensors/people_now_present/"
run: cd firmware && cargo check --target riscv32imc-unknown-none-elf --release

rustfmt:
name: Check code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.82.0
components: rustfmt
override: true
- run: cd firmware && cargo fmt -- --check
4 changes: 4 additions & 0 deletions firmware/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ name = "firmware"
harness = false # do not use the built in cargo test harness -> resolve rust-analyzer errors

[profile.release]
lto = true
opt-level = "s"
incremental = false
codegen-units = 1
debug = true # note: debug = true is okay - debuginfo isn't flashed to the device!

[profile.dev]
debug = true # Symbols are nice and they don't increase the size on Flash
Expand Down

0 comments on commit 3cc0865

Please sign in to comment.