Skip to content
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
39 changes: 39 additions & 0 deletions .github/workflows/build-nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: build-nix
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
container:
image: nixos/nix:latest
steps:
- name: test
run: |
set -x

git clone https://github.com/${{ github.repository }}.git
cd $(basename ${{ github.repository }})

if [ "${{ github.event_name }}" = "pull_request" ]; then
git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-${{ github.event.pull_request.number }}
git checkout pr-${{ github.event.pull_request.number }}
else
git checkout ${{ github.ref_name }}
fi

nix-shell --run "
ODOC_WARN_ERROR=true
dune build @fmt &&
dune build @doc &&
dune build @install &&
dune runtest
"

nix-shell -p git --run "
git diff --exit-code smtml.opam
"
40 changes: 40 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{ pkgs ? import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz";
}) {}
}:

pkgs.mkShell {
dontDetectOcamlConflicts = true;
nativeBuildInputs = with pkgs.ocamlPackages; [
dune_3
dune-glob
findlib
bisect_ppx
mdx
menhir
merlin
ocaml
ocamlformat
ocp-browser
odoc
ounit2
];
buildInputs = with pkgs.ocamlPackages; [
bos
cmdliner
dolmen_model
dolmen_type
fpath
hc
menhirLib
mtime
ocaml_intrinsics
patricia-tree
prelude
scfg
sexplib
yojson
z3
zarith
];
}
Loading