File tree Expand file tree Collapse file tree 9 files changed +25
-33
lines changed Expand file tree Collapse file tree 9 files changed +25
-33
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,10 @@ set -euo pipefail
33
44function templateTest () {
55 # Build haskell executable
6- nix build \
7- ${OVERRIDE_HASKELL_FLAKE} \
8- ${OVERRIDE_NIXPKGS}
6+ nix build ${OVERRIDE_ALL}
97 # Test haskell devshell (via HLS check)
108 nix develop \
11- ${OVERRIDE_HASKELL_FLAKE} \
12- ${OVERRIDE_NIXPKGS} \
9+ ${OVERRIDE_ALL} \
1310 -c haskell-language-server
1411}
1512
Original file line number Diff line number Diff line change 11source ../../test/common.sh
22
3- nix eval -I nixpkgs=flake:github:nixos/nixpkgs/bb31220cca6d044baa6dc2715b07497a2a7c4bc7 \
3+ nix eval -I nixpkgs=flake:${NIXPKGS_URL} \
44 --impure --expr ' import ./parser_tests.nix {}'
Original file line number Diff line number Diff line change 1414DIR_OF_COMMON_SH=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
1515HASKELL_FLAKE=${DIR_OF_COMMON_SH} /..
1616OVERRIDE_HASKELL_FLAKE=" --override-input haskell-flake path:${HASKELL_FLAKE} "
17- OVERRIDE_NIXPKGS=" --override-input nixpkgs github:nixos/nixpkgs/bb31220cca6d044baa6dc2715b07497a2a7c4bc7"
17+
18+ # Let's pin both nixpkgs and flake-parts across all tests, to save up on CI time.
19+ NIXPKGS_URL=" github:nixos/nixpkgs/bb31220cca6d044baa6dc2715b07497a2a7c4bc7"
20+ OVERRIDE_NIXPKGS=" --override-input nixpkgs ${NIXPKGS_URL} "
21+ OVERRIDE_FLAKE_PARTS=" --override-input flake-parts github:hercules-ci/flake-parts/7c7a8bce3dffe71203dcd4276504d1cb49dfe05f"
22+
23+ OVERRIDE_ALL=" ${OVERRIDE_HASKELL_FLAKE} ${OVERRIDE_FLAKE_PARTS} ${OVERRIDE_NIXPKGS} "
1824
1925currentver=" $( nix eval --raw --expr builtins.nixVersion) "
2026requiredver=" 2.14.1"
Original file line number Diff line number Diff line change 33 # pinning), we must specify revisions for *all* inputs to ensure
44 # reproducibility.
55 inputs = {
6- nixpkgs . url = "github:nixos/nixpkgs/bb31220cca6d044baa6dc2715b07497a2a7c4bc7" ;
7- flake-parts . url = "github:hercules-ci/flake-parts/7c7a8bce3dffe71203dcd4276504d1cb49dfe05f" ;
8-
9- # We do not specify a value for this input, because it is explicitly
10- # specified using --override-input to point to ../. For example,
11- # `nix build --override-input haskell-flake ..`
6+ nixpkgs = { } ;
7+ flake-parts = { } ;
128 haskell-flake = { } ;
139 } ;
1410 outputs = inputs @{ self , nixpkgs , flake-parts , ... } :
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ set -euxo pipefail
33
44# First, build the flake
55logHeader " Testing nix build"
6- nix build ${OVERRIDE_HASKELL_FLAKE }
6+ nix build ${OVERRIDE_ALL }
77# Run the devshell test script in a nix develop shell.
88logHeader " Testing nix devshell"
9- nix develop ${OVERRIDE_HASKELL_FLAKE } -c echo
9+ nix develop ${OVERRIDE_ALL } -c echo
Original file line number Diff line number Diff line change 33 # pinning), we must specify revisions for *all* inputs to ensure
44 # reproducibility.
55 inputs = {
6- nixpkgs . url = "github:nixos/nixpkgs/bb31220cca6d044baa6dc2715b07497a2a7c4bc7" ;
7- flake-parts . url = "github:hercules-ci/flake-parts/7c7a8bce3dffe71203dcd4276504d1cb49dfe05f" ;
6+ nixpkgs = { } ;
7+ flake-parts = { } ;
8+ haskell-flake = { } ;
9+
810 check-flake . url = "github:srid/check-flake/48a17393ed4fcd523399d6602c283775b5127295" ;
911
1012 haskell-multi-nix . url = "github:srid/haskell-multi-nix/7aed736571714ec12105ec110358998d70d59e34" ;
1113 haskell-multi-nix . flake = false ;
12-
13- # We do not specify a value for this input, because it is explicitly
14- # specified using --override-input to point to ../. For example,
15- # `nix build --override-input haskell-flake ..`
16- haskell-flake = { } ;
1714 } ;
1815 outputs = inputs @{ self , nixpkgs , flake-parts , ... } :
1916 flake-parts . lib . mkFlake { inherit inputs ; } {
Original file line number Diff line number Diff line change @@ -3,12 +3,12 @@ set -euxo pipefail
33
44# First, build the flake
55logHeader " Testing nix build"
6- nix build ${OVERRIDE_HASKELL_FLAKE }
6+ nix build ${OVERRIDE_ALL }
77# Run the devshell test script in a nix develop shell.
88logHeader " Testing nix devshell"
9- nix develop ${OVERRIDE_HASKELL_FLAKE } -c ./test-in-devshell.sh
9+ nix develop ${OVERRIDE_ALL } -c ./test-in-devshell.sh
1010# Test non-devshell features:
1111# Checks
1212logHeader " Testing nix flake checks"
1313nix --option sandbox false \
14- build ${OVERRIDE_HASKELL_FLAKE } -L .# check
14+ build ${OVERRIDE_ALL } -L .# check
Original file line number Diff line number Diff line change 33 # pinning), we must specify revisions for *all* inputs to ensure
44 # reproducibility.
55 inputs = {
6- nixpkgs . url = "github:nixos/nixpkgs/bb31220cca6d044baa6dc2715b07497a2a7c4bc7" ;
7- flake-parts . url = "github:hercules-ci/flake-parts/7c7a8bce3dffe71203dcd4276504d1cb49dfe05f" ;
8-
9- # We do not specify a value for this input, because it is explicitly
10- # specified using --override-input to point to ../. For example,
11- # `nix build --override-input haskell-flake ..`
6+ nixpkgs = { } ;
7+ flake-parts = { } ;
128 haskell-flake = { } ;
139 } ;
1410 outputs = inputs @{ self , nixpkgs , flake-parts , ... } :
1814 inputs . haskell-flake . flakeModule
1915 ] ;
2016 perSystem = { self' , pkgs , ... } : {
21- haskellProjects . default = { } ;
17+ haskellProjects . default = { } ;
2218 packages . default = self' . packages . haskell-flake-test ;
2319 } ;
2420 } ;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ trap cleanup EXIT
2020logHeader " Testing source filtering"
2121
2222function get_drv_path() {
23- nix eval ${OVERRIDE_HASKELL_FLAKE } .# packages.$SYSTEM.default.drvPath
23+ nix eval ${OVERRIDE_ALL } .# packages.$SYSTEM.default.drvPath
2424}
2525baseline=$( get_drv_path)
2626
You can’t perform that action at this time.
0 commit comments