Skip to content
Open
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
37 changes: 37 additions & 0 deletions .github/workflows/build-nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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 @doc &&
dune build @install
"

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

pkgs.mkShell {
dontDetectOcamlConflicts = true;
nativeBuildInputs = with pkgs.ocamlPackages; [
cppo
dune-configurator
dune_3
findlib
ocaml
odoc
ppx_deriving_yojson
];
buildInputs = with pkgs.ocamlPackages; [
zarith
];
}