-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Expose finalPackages * Check docs in tests * Add docs.sh script * Turn haskell-project.nix into a module * flake-module.nix: Refactor, move to create single perSystem module Co-authored-by: Sridhar Ratnakumar <[email protected]>
- Loading branch information
Showing
5 changed files
with
116 additions
and
51 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,18 @@ | ||
#!/usr/bin/env sh | ||
|
||
# Renders the docs, prints the location of the docs, opens the docs if possible | ||
# | ||
# Does not run the link checker. That's done in runtest.sh. | ||
|
||
nix --option sandbox false \ | ||
build --override-input haskell-flake path:${FLAKE} \ | ||
-L --show-trace \ | ||
github:hercules-ci/flake.parts-website \ | ||
"$@" | ||
|
||
echo "Docs rendered to $PWD/result/options/haskell-flake.html" | ||
|
||
# Works on linux | ||
if type xdg-open &>/dev/null; then | ||
xdg-open result/options/haskell-flake.html | ||
fi |
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
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 |
---|---|---|
@@ -1,18 +1,35 @@ | ||
set -e | ||
|
||
if [ "$(uname)" == "Darwin" ]; then | ||
SYSTEM=aarch64-darwin | ||
function logHeader { | ||
echo "\n||| $@" | ||
} | ||
else | ||
SYSTEM=x86_64-linux | ||
function logHeader { | ||
echo -e "\n||| $@" | ||
} | ||
fi | ||
|
||
FLAKE=$(pwd) | ||
cd ./test | ||
|
||
# First, build the flake. | ||
echo "\n||| Testing nix build" | ||
logHeader "Testing nix build" | ||
nix build --override-input haskell-flake path:${FLAKE} | ||
# Run the devshell test script in a nix develop shell. | ||
echo "\n||| Testing nix devshell" | ||
logHeader "Testing nix devshell" | ||
nix develop --override-input haskell-flake path:${FLAKE} -c ./test.sh | ||
# Test non-devshell features: | ||
# Checks | ||
echo "\n||| Testing nix flake checks" | ||
logHeader "Testing nix flake checks" | ||
nix --option sandbox false \ | ||
build --override-input haskell-flake path:${FLAKE} -L .#check | ||
|
||
echo "\n||| All tests passed!" | ||
logHeader "Testing docs" | ||
nix build --override-input haskell-flake path:${FLAKE} \ | ||
--option log-lines 1000 --show-trace \ | ||
github:hercules-ci/flake.parts-website#checks.${SYSTEM}.linkcheck | ||
|
||
logHeader "All tests passed!" |