build phase for rust pedantry

This commit is contained in:
Graham Christensen 2019-01-02 20:06:50 -05:00
parent 164e2ccbe2
commit 87974028d1
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
2 changed files with 38 additions and 2 deletions

View file

@ -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

View file

@ -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; [