Skip to content
Snippets Groups Projects
Commit 9c4774dd authored by Daniel Firth's avatar Daniel Firth
Browse files

Merge branch 'milloni/gitlab-ci' into 'master'

ci: Generate from dhall

See merge request horizon/horizon-plutus!8
parents 18e04dec fc96fdf2
Branches
Tags
No related merge requests found
let Prelude =
env:DHALL_PRELUDE
? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v20.1.0/Prelude/package.dhall
sha256:26b0ef498663d269e4dc6a82b0ee289ec565d683ef4c00d0ebdd25333a5a3c98
let HsSrc =
< FromHackage : { name : Text, version : Text }
| FromGit :
{ url : Text, revision : Optional Text, subdir : Optional Text }
>
let Modifiers =
{ Type = { doJailbreak : Bool, doCheck : Bool }
, default = { doJailbreak = True, doCheck = False }
}
let Attr = λ(a : Type) → { mapKey : Text, mapValue : a }
let HsPkg = {source : HsSrc, modifiers : Modifiers.Type }
let Attr
: ∀(x : Type) → Type
= λ(x : Type) → { mapKey : Text, mapValue : x }
let Step = { script : List Text }
let toStep
: ∀(id : Text) → ∀(prefix : Text) → ∀(x : Text) → Attr Step
= λ(id : Text) →
λ(prefix : Text) →
λ(x : Text) →
{ mapKey = id
, mapValue.script = [ "nix build -L .#${prefix}.${x}" ]
}
let input = Prelude.Map.keys Text HsPkg ./manifest.dhall
let packages =
Prelude.List.map
(Text)
(Attr Step)
( λ(x : Text) →
toStep "Package ${x}" "packages.x86_64-linux" x
)
(input : List Text)
in packages
......@@ -4,7 +4,7 @@ stages:
generate-flake-ci:
stage: generate
script: nix run "git+https://gitlab.homotopic.tech/haskell/flake-to-gitlab-ci" > flake-ci.yml
script: nix run ".#horizon-gen-gitlab-ci" > flake-ci.yml
artifacts:
paths:
- flake-ci.yml
......
......@@ -25,6 +25,7 @@
&& v.type == "derivation"
&& v.meta.broken == false)
hp;
horizon-gen-gitlab-ci = pkgs.writers.writeBashBin "gen-gitlab-ci" "${pkgs.dhall-json}/bin/dhall-to-yaml --file .gitlab-ci.dhall";
in
{
apps = {
......@@ -32,6 +33,10 @@
type = "app";
program = "${hp.horizon-gen-nix}/bin/horizon-gen-nix";
};
horizon-gen-gitlab-ci = {
type = "app";
program = "${horizon-gen-gitlab-ci}/bin/gen-gitlab-ci";
};
};
checks = {
dhall-format = lint-utils.outputs.linters.x86_64-linux.dhall-format ./.;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment