This repository has been archived by the owner on Sep 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
dhall-ci.dhall
90 lines (82 loc) · 2.41 KB
/
dhall-ci.dhall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
let haskellCi = ./haskell-ci.dhall
let concatMap =
https://raw.githubusercontent.com/dhall-lang/dhall-lang/9f259cd68870b912fbf2f2a08cd63dc3ccba9dc3/Prelude/Text/concatMap sha256:7a0b0b99643de69d6f94ba49441cd0fa0507cbdfa8ace0295f16097af37e226f
let dhallInstall =
haskellCi.BuildStep.Name
{ name = "Install dhall"
, run =
''
cabal update
cd "$(mktemp -d /tmp/dhall-XXX)"
cabal install dhall
''
}
let dhallYamlInstall =
haskellCi.BuildStep.Name
{ name = "Install dhall-to-yaml &c."
, run =
''
cabal update
cd "$(mktemp -d /tmp/dhall-XXX)"
cabal install dhall-yaml
''
}
let checkDhall =
λ(dhalls : List Text) →
haskellCi.BuildStep.Name
{ name = "Check Dhall"
, run =
''
export PATH=$HOME/.cabal/bin:$PATH
''
++ concatMap
Text
( λ(d : Text) →
''
dhall --file ${d}
''
)
dhalls
}
let checkDhallYaml =
λ(dhalls : List Text) →
haskellCi.BuildStep.Name
{ name = "Check Dhall can be converted to YAML"
, run =
''
export PATH=$HOME/.cabal/bin:$PATH
''
++ concatMap
Text
( λ(d : Text) →
''
dhall-to-yaml-ng --file ${d}
''
)
dhalls
}
let dhallSteps =
λ(steps : List haskellCi.BuildStep) →
haskellCi.ciNoMatrix
( [ haskellCi.checkout
, haskellCi.haskellEnv haskellCi.latestEnv
, haskellCi.cache
, dhallInstall
]
# steps
)
⫽ { name = "Dhall CI" }
: haskellCi.CI.Type
let dhallCi =
λ(dhalls : List Text) →
dhallSteps [ checkDhall dhalls ] : haskellCi.CI.Type
in { dhallInstall
, dhallYamlInstall
, dhallCi
, checkDhall
, checkDhallYaml
, dhallSteps
, CI = haskellCi.CI.Type
, BuildStep = haskellCi.BuildStep
, Event = haskellCi.Event
}