diff --git a/.travis.yml b/.travis.yml index 185cb31..f2c6bb4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,11 @@ nix: 2.1 sudo: true matrix: include: + - name: checkPhase - Nix 2 + script: nix-shell --run checkPhase --arg useNix1 false - name: checkPhase - Nix 2 script: nix-shell --run checkPhase --arg useNix1 false - name: checkPhase - Nix 1 script: nix-shell --run checkPhase --arg useNix1 true - - name: nix-build - script: nix-build -A ofborg.rs + - name: cargo pedantry + script: nix-shell --run pedantryPhase --arg useNix1 false -A mozilla-rust-overlay diff --git a/shell.nix b/shell.nix index 7037736..5322088 100644 --- a/shell.nix +++ b/shell.nix @@ -35,6 +35,40 @@ let # HISTFILE = "${src}/.bash_hist"; }; + mozilla-rust-overlay = stdenv.mkDerivation (rec { + name = "gh-event-forwarder"; + buildInputs = with pkgs; [ + bash + nix-prefetch-git + rust.rustc + rust.cargo + #rustfmt + #carnix + openssl.dev + pkgconfig + git + ] + ++ stdenv.lib.optional useNix1 oldpkgs.nix1 + ++ stdenv.lib.optional stdenv.isDarwin pkgs.darwin.Security; + + postHook = '' + checkPhase() { + ( cd "${builtins.toString ./.}/ofborg" && cargo build && cargo test) + } + ''; + + 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"; + LOCALE_ARCHIVE_2_27 = "${pkgs.glibcLocales}/lib/locale/locale-archive"; + }); + rustEnv = stdenv.mkDerivation (rec { name = "gh-event-forwarder"; buildInputs = with pkgs; [