CI: update nightly toolchain #193
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |