Skip to content

Commit

Permalink
chore(ci): add nix flake build (#75)
Browse files Browse the repository at this point in the history
* chore(ci): add nix flake build

* chore(flake): add binsider-debug package for CI
  • Loading branch information
ch4og authored Oct 9, 2024
1 parent 4bc6b7a commit c11c887
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 19 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,27 @@ jobs:
name: binsider-${{ matrix.build.TARGET }}-assets
path: target/debug/binsider*

nix-flake:
name: Build Nix flake
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Install Nix
uses: nixbuild/nix-quick-install-action@v27

- name: Restore and cache Nix store
uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
gc-max-store-size-linux: 1073741824
purge: false

- name: Check Nix flake
run: nix flake check --all-systems

test:
name: Test
runs-on: ubuntu-latest
Expand Down
42 changes: 23 additions & 19 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,33 @@
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
binsider' = { buildType }: pkgs.rustPlatform.buildRustPackage {
name = "binsider";
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
};
checkType = "debug";
inherit buildType;
checkFlags = [
"--skip=test_extract_strings"
"--skip=test_init"
];
meta = with pkgs.lib; {
description = "Analyze ELF binaries like a boss";
homepage = "https://binsider.dev/";
license = [ licenses.mit licenses.asl20 ];
};
};
in
{
rec {
packages = rec {
binsider = pkgs.rustPlatform.buildRustPackage {
name = "binsider";
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
};
checkType = "debug";
checkFlags = [
"--skip=test_extract_strings"
"--skip=test_init"
];
meta = with pkgs.lib; {
description = "Analyze ELF binaries like a boss";
homepage = "https://binsider.dev/";
license = [ licenses.mit licenses.asl20 ];
};
};
binsider = binsider' { buildType = "release"; };
binsider-debug = binsider' { buildType = "debug"; };
default = binsider;
};
checks.check = packages.binsider-debug;

}
);

}

0 comments on commit c11c887

Please sign in to comment.