WIP
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Bruno BELANYI 2022-07-28 13:24:41 +02:00
parent 0c73caaf60
commit b5a66a7a27
2 changed files with 40 additions and 36 deletions

View file

@ -6,7 +6,9 @@ name: abacus checks
steps:
- name: pre commit check
commands:
- nix develop . --command pre-commit run --all
- nix develop . --command cargo vendor
- mkdir -p .cargo/
- echo -e '[source.crates-io]\nreplace-with = "vendored-sources"\n[source.vendored-sources]\ndirectory = "vendor"' >> .cargo/config.toml
- name: flake check
commands:

View file

@ -80,42 +80,44 @@
rustc = my-rust;
};
inherit (pkgs) lib;
pre-commit =
let
# See https://github.com/cachix/pre-commit-hooks.nix/issues/126
rust-env = pkgs.buildEnv {
name = "rust-env";
buildInputs = [ pkgs.makeWrapper ];
paths = [ my-rust ];
pathsToLink = [ "/" "/bin" ];
postBuild = ''
for i in $out/bin/*; do
wrapProgram "$i" --prefix PATH : "$out/bin"
done
'';
};
in
pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
clippy = {
enable = true;
entry = lib.mkForce "${rust-env}/bin/cargo-clippy clippy";
};
nixpkgs-fmt = {
enable = true;
};
rustfmt = {
enable = true;
entry = lib.mkForce "${rust-env}/bin/cargo-fmt fmt -- --check --color always";
};
};
};
in
rec {
checks = {
pre-commit =
let
# See https://github.com/cachix/pre-commit-hooks.nix/issues/126
rust-env = pkgs.buildEnv {
name = "rust-env";
buildInputs = [ pkgs.makeWrapper ];
paths = [ my-rust ];
pathsToLink = [ "/" "/bin" ];
postBuild = ''
for i in $out/bin/*; do
wrapProgram "$i" --prefix PATH : "$out/bin"
done
'';
};
in
pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
clippy = {
enable = true;
entry = lib.mkForce "${rust-env}/bin/cargo-clippy clippy";
};
nixpkgs-fmt = {
enable = true;
};
rustfmt = {
enable = true;
entry = lib.mkForce "${rust-env}/bin/cargo-fmt fmt -- --check --color always";
};
};
};
};
devShells = {
default = pkgs.mkShell {
@ -129,7 +131,7 @@
my-rust
];
inherit (pre-commit) shellHook;
inherit (checks.pre-commit) shellHook;
RUST_SRC_PATH = "${my-rust}/lib/rustlib/src/rust/library";
};