Skip to content

Commit

Permalink
Merge pull request #266 from turion/dev_ci
Browse files Browse the repository at this point in the history
Allow different versions of GHC on CI
  • Loading branch information
turion authored May 10, 2023
2 parents 256aad7 + f6d02c9 commit 840f8bf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ jobs:
run: nix --print-build-logs build .#packages.${{ matrix.system }}.monad-bayes
- name: Development environment
run: nix --print-build-logs develop .#packages.${{ matrix.system }}.monad-bayes --command echo Ready
- name: All GHCs
run: nix --print-build-logs build .#packages.${{ matrix.system }}.monad-bayes-all-ghcs
44 changes: 16 additions & 28 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,35 +71,21 @@
"^.*\.md"
];

monad-bayes = pkgs.haskell.packages.ghc902.developPackage {
name = "monad-bayes";
root = src;

# Remove this override when bumping nixpkgs
source-overrides = {
vty = pkgs.fetchzip {
url = "mirror://hackage/vty-5.37/vty-5.37.tar.gz";
sha256 = "sha256-OOrJBi/mSIyaibgObrp6NmUTWxRu9pxmjAL0EuPV9wY=";
};

text-zipper = pkgs.fetchzip {
url = "mirror://hackage/text-zipper-0.12/text-zipper-0.12.tar.gz";
sha256 = "sha256-P2/UHuG3UuSN7G31DyYvyUWSyIj2YXAOmjGkHtTaP8o=";
};

bimap = pkgs.fetchzip {
url = "mirror://hackage/bimap-0.5.0/bimap-0.5.0.tar.gz";
sha256 = "sha256-pbw+xg9Qz/c7YoXAJg8SR11RJGmgMw5hhnzKv+bGK9w=";
};

brick = pkgs.fetchzip {
url = "mirror://hackage/brick-1.4/brick-1.4.tar.gz";
sha256 = "sha256-KDa7RVQQPpinkJ0aKsYP0E50pn2auEIP38l6Uk7GmmE=";
};
monad-bayes-per-ghc = let
opts = {
name = "monad-bayes";
root = src;
cabal2nixOptions = "--benchmark -fdev";
};
ghcs = [ # Always keep this up to date with the tested-with section in monad-bayes.cabal!
"ghc902"
"ghc927"
];
buildForVersion = ghcVersion: (builtins.getAttr ghcVersion pkgs.haskell.packages).developPackage opts;
in lib.attrsets.genAttrs ghcs buildForVersion;

cabal2nixOptions = "--benchmark -fdev";
};
monad-bayes = monad-bayes-per-ghc.ghc902;
monad-bayes-all-ghcs = pkgs.linkFarm "monad-bayes-all-ghcs" monad-bayes-per-ghc;

jupyterEnvironment = mkJupyterlabFromPath ./kernels {inherit pkgs monad-bayes;};

Expand Down Expand Up @@ -135,7 +121,9 @@
};
};
in rec {
packages = {inherit monad-bayes pre-commit jupyterEnvironment;};
packages = {
inherit monad-bayes monad-bayes-per-ghc monad-bayes-all-ghcs pre-commit jupyterEnvironment;
};
packages.default = packages.monad-bayes;
checks = {inherit monad-bayes pre-commit;};
devShells.default = monad-bayes-dev;
Expand Down
2 changes: 1 addition & 1 deletion monad-bayes.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ copyright: 2015-2020 Adam Scibior
maintainer: [email protected]
author: Adam Scibior <[email protected]>
stability: experimental
tested-with: GHC ==9.2.2
tested-with: GHC ==9.0.2 || ==9.2.7
homepage: http://github.com/tweag/monad-bayes#readme
bug-reports: https://github.com/tweag/monad-bayes/issues
synopsis: A library for probabilistic programming.
Expand Down

0 comments on commit 840f8bf

Please sign in to comment.