Skip to content

Commit

Permalink
Persist generated bounds to dummy file
Browse files Browse the repository at this point in the history
  • Loading branch information
sellout committed Mar 13, 2024
1 parent 6ed59ad commit 8d1dcb8
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 7 deletions.
18 changes: 12 additions & 6 deletions .config/project/github-ci.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
...
}: let
planName = "plan-\${{ runner.os }}-\${{ matrix.ghc }}\${{ matrix.bounds }}";
cabalFilePattern = "planned-bounds.cabal";
in {
services.github.workflow."build.yml".text = lib.generators.toYAML {} {
name = "CI";
Expand Down Expand Up @@ -96,20 +97,25 @@ in {
}
{run = "cabal install cabal-plan-bounds";}
{
name = "Load plans";
name = "download Cabal plans";
uses = "actions/download-artifact@v4";
"with" = {
path = "plans";
pattern = "plan-*";
merge-multiple = true;
};
}
{run = "find plans/";}
{run = "find . -name '*.cabal' -exec cabal-plan-bounds plans/*.json --cabal {} \\;";}
{run = "git diff **/*.cabal";}
{
name = "Fail if .cabal file was changed";
run = "git diff-files --quiet **/*.cabal || exit 1";
name = "Cabal plans considered in generated bounds";
run = "find plans/";
}
{
name = "update generated bounds";
run = "find . -name '${cabalFilePattern}' -exec cabal-plan-bounds plans/*.json --cabal {} \\;";
}
{
name = "check if bounds have changed";
run = "git diff --exit-code ${cabalFilePattern}";
}
];
};
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions planned-bounds.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
cabal-version: 3.4

name: planned-bounds
version: 0.1.0.0
synopsis: Dependency bounds as determined by `cabal-plan-bounds`.
description: This is a non-built package intended to catch changes in our
dependency bounds. The actual packages use slightly different
bounds in some cases (always accompanied by a comment), and a
clearer syntax (see cabal-plan-bounds#18). This allows us to still
have a check that fails and forces us to review changes without
having to match `cabal-plan-bounds`’ results exactly.

library
build-depends:
Cabal,
QuickCheck,
base,
bifunctors,
cabal-doctest,
comonad,
containers,
deriving-compat,
doctest,
either,
foldable1-classes-compat,
free,
hedgehog,
kan-extensions,
lens,
profunctors,
splitmix,
strict,
template-haskell,
th-abstraction,
transformers

0 comments on commit 8d1dcb8

Please sign in to comment.