File tree Expand file tree Collapse file tree 3 files changed +70
-0
lines changed Expand file tree Collapse file tree 3 files changed +70
-0
lines changed Original file line number Diff line number Diff line change 1+ let haskellCi =
2+ https://raw.githubusercontent.com/sorki/github-actions-dhall/main/haskell-ci.dhall
3+ sha256:9e49c0d57a38ab766825b3d2de6656d998b15eec873982db97d590ef58298601
4+
5+ let defSteps = haskellCi.defaultCabalSteps
6+
7+ in haskellCi.generalCi
8+ ( haskellCi.withNix
9+ ( defSteps
10+ with extraSteps.pre
11+ =
12+ defSteps.extraSteps.pre
13+ # [ haskellCi.installCachixStep "hnix-store"
14+ , haskellCi.BuildStep.NameIf
15+ { name = "Install libsodium"
16+ , run = "sudo apt install libsodium-dev"
17+ , `if` = "matrix.os == 'ubuntu-latest'"
18+ }
19+ ]
20+ )
21+ )
22+ haskellCi.DhallMatrix::{
23+ , ghc =
24+ [ haskellCi.GHC.GHC963
25+ , haskellCi.GHC.GHC947
26+ , haskellCi.GHC.GHC902
27+ , haskellCi.GHC.GHC8107
28+ ]
29+ , os = [ haskellCi.OS.Ubuntu, haskellCi.OS.MacOS ]
30+ }
31+ : haskellCi.CI.Type
Original file line number Diff line number Diff line change 44set -eo pipefail
55cd " $( dirname " ${BASH_SOURCE[0]} " ) "
66
7+ which dhall || cabal install dhall
78which dhall-to-yaml || cabal install dhall-yaml
9+
10+ echo " cp haskellCi.dhall -> ci.dhall.frozen"
11+ cp ci.dhall ci.dhall.frozen
12+ echo " dhall freez-ing ci.dhall.frozen"
13+ dhall freeze ci.dhall.frozen
814echo " regenerating ci.yaml"
915dhall-to-yaml-ng --generated-comment --file ci.dhall > ci.yaml
Original file line number Diff line number Diff line change 1+ # Matrix build for all packages and compilers
2+ #
3+ # Uses ./.github/workflows/ci.dhall as a single source of
4+ # truth for a list of supported compilers
5+ #
6+ # The dhall expression needs to be frozen via dhall freeze
7+ # which is done automatically when we update it via ./.github/workflows/ci.sh
8+ # and dhallDirectoryToNix uses ci.dhall.frozen instead
9+ { pkgs ? import <nixpkgs> { }
10+ } :
11+ let
12+ lib = pkgs . lib ;
13+ ciDhallNix = pkgs . dhallDirectoryToNix { src = ./.github/workflows ; file = "ci.dhall.frozen" ; } ;
14+ ciCompilers = ciDhallNix . jobs . build . strategy . matrix . ghc ;
15+
16+ # from e.g. 9.6.3 to ghc963
17+ convertCompilers = cs :
18+ map ( x : "ghc${ lib . strings . replaceStrings [ "." ] [ "" ] x } " ) cs ;
19+
20+ compilers =
21+ lib . traceValFn ( cs :
22+ let
23+ prettyCs = lib . concatMapStringsSep "\n " ( c : "- ${ c } " ) cs ;
24+ in
25+ "building for compilers:\n ${ prettyCs } " )
26+ ( convertCompilers ciCompilers ) ;
27+ in
28+ pkgs . lib . recurseIntoAttrs
29+ ( pkgs . lib . genAttrs compilers ( compiler :
30+ pkgs . lib . recurseIntoAttrs
31+ ( import ./. { inherit pkgs compiler ; } )
32+ )
33+ )
You can’t perform that action at this time.
0 commit comments