Skip to content

Commit

Permalink
Nix build for different coq versions.
Browse files Browse the repository at this point in the history
Make devShells for coq 8.18, coq 8.19 and coq master.
Run them all in the CI.
  • Loading branch information
rtetley committed Feb 5, 2024
1 parent 4b986bf commit 9b99cb6
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
coq: [coq-8-18, coq-8-19, coq-master]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
Expand All @@ -41,7 +42,7 @@ jobs:
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: nix develop .#vscoq-language-server -c bash -c "cd language-server && dune build"
- run: nix develop .#vscoq-language-server-${{ matrix.coq }} -c bash -c "cd language-server && dune build"
- run: nix develop .#vscoq-client -c bash -c "cd client && yarn run install:all && yarn run build:all && yarn run compile"
- run: xvfb-run nix develop .#vscoq-client -c bash -c "cd client && yarn test"
if: runner.os == 'Linux'
Expand Down
58 changes: 57 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

98 changes: 92 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,88 @@

flake-utils.url = "github:numtide/flake-utils";

coq-master = { url = "github:coq/coq/fbaea89860348ca2b2ca485e52df7215bea27746"; }; # Should be kept in sync with PIN_COQ in CI workflow
coq-master.inputs.nixpkgs.follows = "nixpkgs";

};

outputs = { self, nixpkgs, flake-utils }:
outputs = { self, nixpkgs, flake-utils, coq-master }:
flake-utils.lib.eachDefaultSystem (system:

let coq = coq-master.defaultPackage.${system}; in
rec {

packages.default = self.packages.${system}.vscoq-language-server;
packages.default = self.packages.${system}.vscoq-language-server-coq-8-19;

packages.vscoq-language-server =
packages.vscoq-language-server-coq-8-18 =
# Notice the reference to nixpkgs here.
with import nixpkgs { inherit system; };
let ocamlPackages = ocaml-ng.ocamlPackages_4_14; in
ocamlPackages.buildDunePackage {
duneVersion = "3";
pname = "vscoq-language-server";
version = "2.0.3";
src = ./language-server;
buildInputs = [
coq_8_18
dune_3
] ++ (with coq.ocamlPackages; [
lablgtk3-sourceview3
glib
gnome.adwaita-icon-theme
wrapGAppsHook
ocaml
yojson
zarith
findlib
ppx_inline_test
ppx_assert
ppx_sexp_conv
ppx_deriving
ppx_optcomp
ppx_import
sexplib
ppx_yojson_conv
lsp
sel
]);
};

packages.vscoq-language-server-coq-8-19 =
# Notice the reference to nixpkgs here.
with import nixpkgs { inherit system; };
let ocamlPackages = ocaml-ng.ocamlPackages_4_14; in
ocamlPackages.buildDunePackage {
duneVersion = "3";
pname = "vscoq-language-server";
version = "2.0.3";
src = ./language-server;
buildInputs = [
coq_8_19
dune_3
] ++ (with coq.ocamlPackages; [
lablgtk3-sourceview3
glib
gnome.adwaita-icon-theme
wrapGAppsHook
ocaml
yojson
zarith
findlib
ppx_inline_test
ppx_assert
ppx_sexp_conv
ppx_deriving
ppx_optcomp
ppx_import
sexplib
ppx_yojson_conv
lsp
sel
]);
};

packages.vscoq-language-server-coq-master =
# Notice the reference to nixpkgs here.
with import nixpkgs { inherit system; };
let ocamlPackages = ocaml-ng.ocamlPackages_4_14; in
Expand Down Expand Up @@ -68,18 +140,32 @@
buildInputs = self.packages.${system}.vscoq-client.buildInputs;
};

devShells.vscoq-language-server =
devShells.vscoq-language-server-coq-8-18 =
with import nixpkgs { inherit system; };
mkShell {
buildInputs =
self.packages.${system}.vscoq-language-server-coq-8-18.buildInputs;
};

devShells.vscoq-language-server-8-19 =
with import nixpkgs { inherit system; };
mkShell {
buildInputs =
self.packages.${system}.vscoq-language-server-coq-8-19.buildInputs;
};

devShells.vscoq-language-server-coq-master =
with import nixpkgs { inherit system; };
mkShell {
buildInputs =
self.packages.${system}.vscoq-language-server.buildInputs;
self.packages.${system}.vscoq-language-server-coq-master.buildInputs;
};

devShells.default =
with import nixpkgs { inherit system; };
mkShell {
buildInputs =
self.packages.${system}.vscoq-language-server.buildInputs
self.packages.${system}.vscoq-language-server-coq-8-19.buildInputs
++ (with ocamlPackages; [
ocaml-lsp
]);
Expand Down

0 comments on commit 9b99cb6

Please sign in to comment.