Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: set up CI #43

Merged
merged 2 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Nix Build"
on:
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
ocamlVersion: [5_1]
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v21
with:
extra_nix_config: |
extra-substituters = https://anmonteiro.nix-cache.workers.dev
extra-trusted-public-keys = ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=
- name: "Run Nix tests"
run: nix build .#

3 changes: 2 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@
(depends
(ocaml
(>= "4.13.0"))
melange))
(melange
(>= "2.0.0"))))
27 changes: 18 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
melange-src.overlays.default
];
inherit (pkgs) nodejs_latest lib stdenv darwin;
mkShell = { inputsFrom, buildInputs ? [ ] }: pkgs.mkShell {
nativeBuildInputs = with pkgs; [
yarn
nodejs_latest
] ++ (with pkgs.ocamlPackages; [
ocamlformat
merlin
]);
inherit inputsFrom buildInputs;
};
in
rec {
packages = {
Expand All @@ -36,15 +46,14 @@
propagatedBuildInputs = with pkgs.ocamlPackages; [ melange ];
};
};
devShells.default = pkgs.mkShell {
inputsFrom = [ packages.default ];
nativeBuildInputs = with pkgs; [
yarn
nodejs_latest
] ++ (with pkgs.ocamlPackages; [
ocamlformat
merlin
]);
devShells = {
default = mkShell {
inputsFrom = [ packages.default ];
};
release = mkShell {
inputsFrom = [ packages.default ];
buildInputs = with pkgs; [ cacert curl ocamlPackages.dune-release git ];
};
};
});
}
2 changes: 1 addition & 1 deletion melange-fetch.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ bug-reports: "https://github.com/melange-community/melange-fetch"
depends: [
"dune" {>= "3.8"}
"ocaml" {>= "4.13.0"}
"melange"
"melange" {>= "2.0.0"}
"odoc" {with-doc}
]
build: [
Expand Down
Loading