From 2ddcdedabeaffcbdef7e0e7564e1a7ce244767aa Mon Sep 17 00:00:00 2001 From: Vehbi Sinan Tunalioglu Date: Tue, 23 Apr 2024 08:49:56 +0800 Subject: [PATCH] test: add test and build script for development shell --- default.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/default.nix b/default.nix index 5a9c7db..236ffe6 100644 --- a/default.nix +++ b/default.nix @@ -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: @@ -92,6 +113,9 @@ let pkgs.nixpkgs-fmt pkgs.nodePackages.prettier pkgs.upx + + ## Our custom development scripts: + dev-test-build ]; };