Check clippy and fmt in travis
This commit is contained in:
parent
87974028d1
commit
671a9257c9
|
@ -10,4 +10,4 @@ matrix:
|
|||
- name: checkPhase - Nix 1
|
||||
script: nix-shell --run checkPhase --arg useNix1 true
|
||||
- name: cargo pedantry
|
||||
script: nix-shell --run pedantryPhase --arg useNix1 false -A mozilla-rust-overlay
|
||||
script: nix-shell --run checkPhase --arg useNix1 false -A mozilla-rust-overlay
|
||||
|
|
35
shell.nix
35
shell.nix
|
@ -36,33 +36,35 @@ let
|
|||
};
|
||||
|
||||
mozilla-rust-overlay = stdenv.mkDerivation (rec {
|
||||
name = "gh-event-forwarder";
|
||||
name = "mozilla-rust-overlay";
|
||||
buildInputs = with pkgs; [
|
||||
bash
|
||||
nix-prefetch-git
|
||||
rust.rustc
|
||||
rust.cargo
|
||||
#rustfmt
|
||||
#carnix
|
||||
openssl.dev
|
||||
pkgconfig
|
||||
latest.rustChannels.stable.rust
|
||||
git
|
||||
pkgconfig
|
||||
openssl.dev
|
||||
]
|
||||
++ stdenv.lib.optional useNix1 oldpkgs.nix1
|
||||
++ stdenv.lib.optional stdenv.isDarwin pkgs.darwin.Security;
|
||||
|
||||
postHook = ''
|
||||
checkPhase() {
|
||||
( cd "${builtins.toString ./.}/ofborg" && cargo build && cargo test)
|
||||
}
|
||||
checkPhase() (
|
||||
cd "${builtins.toString ./.}/ofborg"
|
||||
|
||||
cargo fmt
|
||||
git diff --exit-code
|
||||
cargofmtexit=$?
|
||||
|
||||
cargo clippy
|
||||
cargoclippyexit=$?
|
||||
|
||||
|
||||
sum=$((cargofmtexit + cargoclippyexit))
|
||||
exit $sum
|
||||
)
|
||||
'';
|
||||
|
||||
HISTFILE = "${toString ./.}/.bash_hist";
|
||||
RUSTFLAGS = "-D warnings";
|
||||
RUST_BACKTRACE = "1";
|
||||
RUST_LOG = "ofborg=debug";
|
||||
NIX_PATH = "nixpkgs=${pkgs.path}";
|
||||
passthru.phpEnv = phpEnv;
|
||||
}
|
||||
// stdenv.lib.optionalAttrs stdenv.isLinux {
|
||||
LOCALE_ARCHIVE_2_21 = "${oldpkgs.glibcLocales}/lib/locale/locale-archive";
|
||||
|
@ -97,6 +99,7 @@ let
|
|||
RUST_LOG = "ofborg=debug";
|
||||
NIX_PATH = "nixpkgs=${pkgs.path}";
|
||||
passthru.phpEnv = phpEnv;
|
||||
passthru.mozilla-rust-overlay = mozilla-rust-overlay;
|
||||
}
|
||||
// stdenv.lib.optionalAttrs stdenv.isLinux {
|
||||
LOCALE_ARCHIVE_2_21 = "${oldpkgs.glibcLocales}/lib/locale/locale-archive";
|
||||
|
|
Loading…
Reference in a new issue