diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b95485d..d899f01 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -30,6 +30,6 @@ jobs: nix develop --command bash -c "cabal build" - name: Test - # NOTE: The onlyCabal shell does not contain cardano-node + # NOTE: The ci shell does not contain cardano-node run: | - nix develop .#onlyCabal --command bash -c "cabal test" + nix develop .#ci --command bash -c "cabal test" diff --git a/flake.nix b/flake.nix index 76847e1..1c84550 100644 --- a/flake.nix +++ b/flake.nix @@ -43,39 +43,43 @@ hspec HUnit ]); + + mkShell = { isCI ? false }: + pkgs.mkShell { + packages = + let + libs = [ + pkgs.pkg-config + pkgs.libsodium-vrf + pkgs.blst + pkgs.secp256k1 + pkgs.zlib + ]; + tools = [ + pkgs.cabal-install + ghcWithPackages + ]; + devTools = [ + hsPkgs.haskell-language-server + hsPkgs.fourmolu + hsPkgs.cabal-fmt + hsPkgs.hoogle + ]; + in + libs ++ tools ++ + pkgs.lib.optionals (isCI == false) devTools ++ + # Cardano-node to build against + pkgs.lib.optional (isCI == false) inputs.cardano-node.packages.${system}.cardano-node + ; + }; + in { legacyPackages = pkgs; - devShells.default = pkgs.mkShell { - packages = - let - libs = [ - pkgs.pkg-config - pkgs.libsodium-vrf - pkgs.blst - pkgs.secp256k1 - pkgs.zlib - ]; - tools = [ - pkgs.cabal-install - hsPkgs.haskell-language-server - hsPkgs.fourmolu - hsPkgs.cabal-fmt - ]; - in - libs ++ tools ++ [ - # Cardano-node to build against - inputs.cardano-node.packages.${system}.cardano-node - ]; - }; - - # Only cabal and no cardano-node to run integration tests - devShells.onlyCabal = pkgs.mkShell { - packages = [ - pkgs.cabal-install - ]; - }; + devShells.default = mkShell { }; + # No dev tools and without cardano-node to run integration tests + devShells.ci = mkShell { isCI = true; }; }); nixConfig = {