Skip to content

Instantly share code, notes, and snippets.

@ptitfred
Created May 3, 2020 13:26
Show Gist options
  • Save ptitfred/6bb32380135f2f9bf51a99aff3010680 to your computer and use it in GitHub Desktop.
Save ptitfred/6bb32380135f2f9bf51a99aff3010680 to your computer and use it in GitHub Desktop.
CI for hmacaroons using haskell.nix
let
# Import the Haskell.nix library,
haskellNix = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/78f4e25f5c45c135d1798fca423420e8baa7589b.tar.gz) {};
nixpkgs = import haskellNix.sources.nixpkgs-1909 haskellNix.nixpkgsArgs;
haskell = nixpkgs.haskell-nix;
# Instantiate a package set using the generated file.
pkgSet = haskell.mkStackPkgSet {
stack-pkgs = (haskell.importAndFilterProject (haskell.callStackToNix {
src = ./.;
})).pkgs;
pkg-def-extras = [
(hackage: { hsc2hs = hackage.hsc2hs."0.68.4".revisions.default; })
];
# pkg-def-overlays = [];
modules = [];
};
in
pkgSet.config.hsPkgs
.PHONY: build
build:
nix build -f ci.nix hmacaroons.components.library
.PHONY: test
test:
nix build -f ci.nix --out-link result-tests hmacaroons.components.tests
result-tests/bin/test
.PHONY: doc
doc:
nix build -f ci.nix hmacaroons.components.library.doc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment