-
Notifications
You must be signed in to change notification settings - Fork 11
177 lines (177 loc) · 5.14 KB
/
build.yml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
{
"jobs": {
"build": {
"env": {
"CONFIG": "--enable-tests --enable-benchmarks ${{ matrix.bounds }}"
},
"runs-on": "${{ matrix.os }}",
"steps": [
{
"uses": "actions/checkout@v4"
},
{
"id": "setup-haskell-cabal",
"uses": "haskell-actions/setup@v2",
"with": {
"cabal-version": "3.10.2.1",
"ghc-version": "${{ matrix.ghc }}"
}
},
{
"run": "cabal v2-freeze $CONFIG"
},
{
"uses": "actions/cache@v4",
"with": {
"key": "${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}",
"path": "${{ steps.setup-haskell-cabal.outputs.cabal-store }}\ndist-newstyle\n"
}
},
{
"run": "cabal v2-build all $CONFIG"
},
{
"run": "cabal v2-test all $CONFIG"
},
{
"run": "mv dist-newstyle/cache/plan.json plan-${{ runner.os }}-${{ matrix.ghc }}${{ matrix.bounds }}.json"
},
{
"name": "Upload build plan as artifact",
"uses": "actions/upload-artifact@v4",
"with": {
"name": "plan-${{ runner.os }}-${{ matrix.ghc }}${{ matrix.bounds }}",
"path": "plan-${{ runner.os }}-${{ matrix.ghc }}${{ matrix.bounds }}.json"
}
}
],
"strategy": {
"fail-fast": false,
"matrix": {
"bounds": [
"--prefer-oldest",
""
],
"exclude": [
{
"ghc": "7.10.3",
"os": "ubuntu-22.04"
},
],
"ghc": [
"7.10.3",
"8.0.2",
"8.2.2",
"8.4.1",
"8.6.1",
"8.8.1",
"8.10.1",
"9.0.1",
"9.2.1",
"9.4.1",
"9.6.1",
"9.8.1"
],
"os": [
"macos-13",
"ubuntu-22.04",
"windows-2022"
]
}
}
},
"check-bounds": {
"if": "always()",
"needs": [
"build"
],
"runs-on": "ubuntu-22.04",
"steps": [
{
"uses": "actions/checkout@v4"
},
{
"id": "setup-haskell-cabal",
"uses": "haskell-actions/setup@v2",
"with": {
"cabal-version": "3.10.2.1",
"ghc-version": "9.6.3"
}
},
{
"run": "## TODO: Remove the manual cloning once cabal-plan-bounds >0.1.5.1\n## is released. Currently, it’s needed because of\n## nomeata/cabal-plan-bounds#19.\ngit clone https://github.com/nomeata/cabal-plan-bounds\ncd cabal-plan-bounds\ncabal install cabal-plan-bounds\n"
},
{
"name": "download Cabal plans",
"uses": "actions/download-artifact@v4",
"with": {
"merge-multiple": true,
"path": "plans",
"pattern": "plan-*"
}
},
{
"name": "Cabal plans considered in generated bounds",
"run": "find plans/"
},
{
"name": "check if bounds have changed",
"run": "diffs=\"$(find . -name '*.cabal' -exec \\\n cabal-plan-bounds \\\n --dry-run \\\n \\\n plans/*.json \\\n --cabal {} \\;)\"\nif [[ -n \"$diffs\" ]]; then\n echo \"$diffs\"\n exit 1\nfi\n"
}
]
},
"check-licenses": {
"if": "always()",
"needs": [
"build"
],
"runs-on": "ubuntu-22.04",
"steps": [
{
"uses": "actions/checkout@v4"
},
{
"id": "setup-haskell-cabal",
"uses": "haskell-actions/setup@v2",
"with": {
"cabal-version": "3.10.2.1",
"ghc-version": "8.10.1"
}
},
{
"run": "cabal install cabal-plan -flicense-report"
},
{
"name": "download Cabal plans",
"uses": "actions/download-artifact@v4",
"with": {
"merge-multiple": true,
"path": "plans",
"pattern": "plan-*"
}
},
{
"run": "mkdir -p dist-newstyle/cache\nmv plans/plan-${{ runner.os }}-8.10.1.json dist-newstyle/cache/plan.json\n"
},
{
"name": "check if licenses have changed",
"run": "{\n echo \"**NB**: This captures the licenses associated with a particular set of dependency versions. If your own build solves differently, it’s possible that the licenses may have changed, or even that the set of dependencies itself is different. Please make sure you run [\\`cabal-plan license-report\\`](https://hackage.haskell.org/package/cabal-plan) on your own components rather than assuming this is authoritative.\"\n echo\n cabal-plan license-report true-name:lib:true-name\n} >\"docs/license-report.md\"\n\ngit diff --exit-code docs/license-report.md\n"
}
]
}
},
"name": "CI",
"on": {
"pull_request": {
"types": [
"opened",
"synchronize"
]
},
"push": {
"branches": [
"master"
]
}
}
}