Skip to content

Commit

Permalink
run tests in sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Jan 7, 2021
1 parent 5313a04 commit 70858c7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 53 deletions.
38 changes: 29 additions & 9 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
{
pkgs ? (import <nixpkgs> {}),
ruby ? pkgs.ruby_2_6,
bundler ? (pkgs.bundler.override { inherit ruby; }),
nix ? pkgs.nix,
nix-prefetch-git ? pkgs.nix-prefetch-git,
{ pkgs ? (import <nixpkgs> {})
, ruby ? pkgs.ruby_2_6
, bundler ? (pkgs.bundler.override { inherit ruby; })
, nix ? pkgs.nix
, nix-prefetch-git ? pkgs.nix-prefetch-git
, rake ? pkgs.rubyPackages.rake
, minitest ? pkgs.rubyPackages.minitest
, nix-prefetch-scripts ? pkgs.nix-prefetch-scripts
}:
pkgs.stdenv.mkDerivation rec {
let
srcWithout = rootPath: ignoredPaths:
let
ignoreStrings = map (path: toString path ) ignoredPaths;
in
builtins.filterSource (path: type: (builtins.all (i: i != path) ignoreStrings)) rootPath;
in pkgs.stdenv.mkDerivation rec {
version = "2.5.0";
name = "bundix";
src = ./.;
phases = "installPhase";
src = srcWithout ./. [ ./.git ./tmp ./result ];
installPhase = ''
mkdir -p $out
makeWrapper $src/bin/bundix $out/bin/bundix \
Expand All @@ -22,6 +29,19 @@ pkgs.stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgs.makeWrapper ];
buildInputs = [ ruby bundler ];

checkInputs = [
rake
minitest

nix-prefetch-scripts
nix
];

doCheck = true;
checkPhase = ''
NIX_STATE_DIR=$TMPDIR/var HOME=$TMPDIR rake test
'';

meta = {
inherit version;
description = "Creates Nix packages from Gemfiles";
Expand Down
44 changes: 0 additions & 44 deletions shell.nix

This file was deleted.

0 comments on commit 70858c7

Please sign in to comment.