-
Notifications
You must be signed in to change notification settings - Fork 2
84 lines (78 loc) · 2.93 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Build
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
env:
CARGO_TERM_COLOR: always
jobs:
firmware:
name: Build firmware
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
rustup target add thumbv7m-none-eabi
rustup component add llvm-tools-preview
cargo install --quiet cargo-binutils
- name: Check formatting
run: |
cargo fmt --check --manifest-path openemc-bootloader/Cargo.toml
cargo fmt --check --manifest-path openemc-firmware/Cargo.toml
cargo fmt --check --manifest-path openemc-log/Cargo.toml
cargo fmt --check --manifest-path openemc-pack/Cargo.toml
cargo fmt --check --manifest-path openemc-shared/Cargo.toml
cargo fmt --check --manifest-path xtask/Cargo.toml
- name: Lint code
run: |
cd openemc-bootloader ; cargo clippy --quiet ; cd ..
cd openemc-firmware ; cargo clippy --quiet ; cd ..
cd openemc-log ; cargo clippy --quiet ; cd ..
cd openemc-pack ; cargo clippy --quiet ; cd ..
cd openemc-shared ; cargo clippy --quiet ; cd ..
cd xtask ; cargo clippy --quiet ; cd ..
- name: Build bootloader
run: cd openemc-bootloader ; cargo build --release --quiet
- name: Build firmware
run: cd openemc-firmware ; cargo build --release --quiet
- name: Build logger
run: cd openemc-log ; cargo build --release --quiet
- name: Build packer
run: cd openemc-pack ; cargo build --quiet
- name: Build generic firmware package
run: cargo xtask
- name: Build firmware package for STM NUCLEO-F103RB using nightly Rust
run: |
TOOLCHAIN="nightly-2024-06-24"
rustup toolchain install $TOOLCHAIN
rustup target add --toolchain $TOOLCHAIN thumbv7m-none-eabi
rustup component add --toolchain $TOOLCHAIN llvm-tools-preview rust-src
cargo +$TOOLCHAIN xtask stm_nucleo_f103rb
- uses: actions/upload-artifact@v3
with:
name: firmware-images
path: |
image/*
target/release/openemc-log
- name: Show firmware size
run: ls -l image/
driver:
name: Build driver
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt install --yes libelf-dev device-tree-compiler
- name: Prepare Linux kernel source
run: |
curl https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.19.12.tar.xz | tar xJ
mv linux-5.19.12 linux
cp -f .github/workflows/kernel.config linux/.config
cd linux
make modules_prepare -j
- name: Build kernel modules
run: LINUX_DIR=$PWD/linux ./scripts/driver-build.sh -j
- name: Build devicetree examples
run: ./scripts/devicetree-build.sh