Skip to content

Commit

Permalink
test: add test and build script for development shell
Browse files Browse the repository at this point in the history
  • Loading branch information
vst committed Apr 23, 2024
1 parent bb01d39 commit 2ddcded
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,27 @@ let
## SHELL ##
###########

## Test and build script for development:
dev-test-build = pkgs.writeShellScriptBin "dev-test-build" ''
#!/usr/bin/env bash
## Fail on any error:
set -e
## Show commands executed:
set -x
hpack
fourmolu --mode check app/ src/ test/
prettier --check .
find . -iname "*.nix" -not -path "*/nix/sources.nix" -print0 | xargs --null nixpkgs-fmt --check
hlint app/ src/ test/
cabal build -O0
cabal run -O0 clompse -- --version
cabal v1-test
cabal haddock -O0
'';

## Prepare Nix shell:
thisShell = thisHaskell.shellFor {
## Define packages for the shell:
Expand Down Expand Up @@ -92,6 +113,9 @@ let
pkgs.nixpkgs-fmt
pkgs.nodePackages.prettier
pkgs.upx

## Our custom development scripts:
dev-test-build
];
};

Expand Down

0 comments on commit 2ddcded

Please sign in to comment.