Skip to content

Commit

Permalink
Build the fw using crane in the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
afilini committed May 25, 2024
1 parent 1a8feb8 commit 4ce14f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,11 @@ jobs:
nix_path: nixpkgs=channel:nixos-unstable
- name: Print nixpkgs version
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
./target
./firmware/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: nix develop .#embedded --command bash -c "cd firmware && cargo build -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --no-default-features --features ${{ matrix.target }} --release"
- run: nix build .#firmware-${{ matrix.target }}
- uses: actions/upload-artifact@v2
with:
name: firmware-${{ matrix.target }}
path: ./firmware/target/thumbv7em-none-eabihf/release/firmware
path: ./result/*

run-firmware-tests:
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,13 @@
packages.model = pkgs.callPackage ./model { inherit pkgs; craneLib = getCrane { withEmbedded = false; }; };
packages.sdk = pkgs.callPackage ./sdk { inherit pkgs; craneLib = getCrane { withEmbedded = false; }; };

packages.firmware-emu = pkgs.callPackage ./firmware rec {
packages.firmware-emulator = pkgs.callPackage ./firmware rec {
inherit pkgs;
rustToolchain = getRust { withEmbedded = true; nightly = true; };
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain;
variant = "emulator";
};
packages.firmware-device = packages.firmware;
packages.firmware = pkgs.callPackage ./firmware rec {
inherit pkgs;
rustToolchain = getRust { withEmbedded = true; nightly = true; };
Expand Down

0 comments on commit 4ce14f6

Please sign in to comment.