Skip to content

Commit

Permalink
chore(nix): stop installing everything in CI
Browse files Browse the repository at this point in the history
dev deps aren't needed to run tests
  • Loading branch information
rgrinberg committed Oct 12, 2024
1 parent 83d0f60 commit 5dd6335
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: nix develop -c dune runtest
- run: nix develop .#test -c dune runtest
24 changes: 17 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
extraBuildInputs = [ pkgs.ocamlPackages.core_bench ];
checkInputs = with pkgs.ocamlPackages; [
ounit
js_of_ocaml
ppx_expect
pkgs.nodejs-slim
];
devInputs = with pkgs.ocamlPackages; [
ocaml-lsp
pkgs.ocamlformat_0_26_2
];
inherit (pkgs.ocamlPackages) buildDunePackage;
in rec {
packages = rec {
Expand All @@ -19,19 +30,18 @@
src = ./.;
duneVersion = "3";
propagatedBuildInputs = with pkgs.ocamlPackages; [ seq ];
# Other check deps depend on re itself
checkInputs = with pkgs.ocamlPackages; [ ounit ];
doCheck = true;
};
};
devShells.test = pkgs.mkShell {
inputsFrom = pkgs.lib.attrValues packages;
buildInputs = extraBuildInputs ++ checkInputs;
};
devShells.default = pkgs.mkShell {
inputsFrom = pkgs.lib.attrValues packages;
buildInputs = with pkgs.ocamlPackages; [
ocaml-lsp
core_bench
pkgs.ocamlformat_0_26_2
js_of_ocaml
pkgs.nodejs-slim
];
buildInputs = extraBuildInputs ++ devInputs;
};
});
}

0 comments on commit 5dd6335

Please sign in to comment.