Skip to content

Commit a826acd

Browse files
Merge pull request #22 from stevenlee7189/xtask_support
feat: Add xtask automation crate and improve project compatibility
2 parents c39c00c + 993da66 commit a826acd

39 files changed

+1991
-565
lines changed

.cargo/config.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Licensed under the Apache-2.0 license
2+
3+
[alias]
4+
xtask = "run --package xtask --target x86_64-unknown-linux-gnu --"
5+
16
[target.thumbv7em-none-eabihf]
27
rustflags = [
38
"-C", "link-arg=-Map=firmware.map"

.github/rust-toolchain.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Licensed under the Apache-2.0 license
2+
3+
[toolchain]
4+
channel = "1.85.1"
5+
components = ["rustfmt", "clippy"] # Add any additional components you need
6+
profile = "minimal" # Optional: You can set this to "minimal", "default", or "complete"

.github/workflows/build-test.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Licensed under the Apache-2.0 license
2+
3+
name: Build and Test
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
precommit:
15+
runs-on: ubuntu-22.04
16+
17+
env:
18+
CARGO_INCREMENTAL: 0
19+
EXTRA_CARGO_CONFIG: "target.'cfg(all())'.rustflags = [\"-Dwarnings\"]"
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with:
25+
submodules: recursive
26+
27+
- name: Install packages
28+
run: |
29+
sudo apt-get update -qy
30+
sudo apt-get install -qy build-essential curl gcc-multilib gcc-riscv64-unknown-elf git
31+
32+
- name: Verify Cargo.lock is up to date
33+
run: |
34+
cargo tree --locked > /dev/null || (
35+
echo "Please update Cargo.lock"
36+
cargo tree
37+
git diff Cargo.lock
38+
exit 1
39+
)
40+
41+
- name: Run precommit checks (build/format/lint)
42+
run: |
43+
cargo --config "$EXTRA_CARGO_CONFIG" xtask precommit

0 commit comments

Comments
 (0)