-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
117 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
ghciwatch, | ||
checksFrom, | ||
checks, | ||
}: | ||
(checksFrom ghciwatch) // checks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
mkCheck, | ||
ghciwatch, | ||
}: | ||
mkCheck { | ||
name = "haskell-project"; | ||
sourceRoot = "source/tests/data/simple"; | ||
nativeBuildInputs = ghciwatch.haskellInputs; | ||
inherit (ghciwatch) GHC_VERSIONS; | ||
|
||
checkPhase = '' | ||
# Need an empty `.cabal/config` or `cabal` errors trying to use the network. | ||
mkdir "$TMPDIR/.cabal" | ||
touch "$TMPDIR/.cabal/config" | ||
export HOME="$TMPDIR" | ||
for VERSION in $GHC_VERSIONS; do | ||
make test GHC="ghc-$VERSION" | ||
done | ||
''; | ||
|
||
meta.description = '' | ||
Check that the Haskell project used for integration tests compiles. | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
mkCheck, | ||
treefmt, | ||
alejandra, | ||
craneLib, | ||
}: | ||
mkCheck { | ||
name = "treefmt"; | ||
nativeBuildInputs = [ | ||
treefmt | ||
alejandra | ||
craneLib.rustfmt | ||
]; | ||
|
||
checkPhase = '' | ||
treefmt --fail-on-change | ||
''; | ||
|
||
meta.description = '' | ||
Check that treefmt runs without changes. | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{lib}: let | ||
name = drv: drv.pname or drv.name; | ||
in | ||
drv: | ||
lib.mapAttrs' | ||
(_name: check: let | ||
drvName = name drv; | ||
checkName = name check; | ||
# If we have `ghciwatch.checks.ghciwatch-fmt` we want `ghciwatch-fmt`, | ||
# not `ghciwatch-ghciwatch-fmt`. | ||
newName = | ||
if lib.hasPrefix drvName checkName | ||
then checkName | ||
else "${drvName}-${checkName}"; | ||
in | ||
lib.nameValuePair newName check) | ||
drv.checks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
stdenv, | ||
inputs, | ||
}: { | ||
name, | ||
checkPhase, | ||
... | ||
} @ args: let | ||
cleanedArgs = builtins.removeAttrs args ["name" "checkPhase"]; | ||
in | ||
stdenv.mkDerivation ({ | ||
name = "${name}-check"; | ||
|
||
src = inputs.self; | ||
|
||
phases = ["unpackPhase" "checkPhase" "installPhase"]; | ||
|
||
inherit checkPhase; | ||
doCheck = true; | ||
|
||
installPhase = '' | ||
touch $out | ||
''; | ||
} | ||
// cleanedArgs) |