Skip to content

Commit f40cd9d

Browse files
authored
Merge pull request #140 from andreasabel/ci
CI on GitHub Actions for GHC 7.0 - 9.2, generated with haskell-ci
2 parents 6719b84 + dfd942b commit f40cd9d

File tree

2 files changed

+310
-33
lines changed

2 files changed

+310
-33
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 267 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,267 @@
1+
# This GitHub workflow config has been generated by a script via
2+
#
3+
# haskell-ci 'github' 'HTTP.cabal'
4+
#
5+
# To regenerate the script (for example after adjusting tested-with) run
6+
#
7+
# haskell-ci regenerate
8+
#
9+
# For more information, see https://github.com/haskell-CI/haskell-ci
10+
#
11+
# version: 0.14.1
12+
#
13+
# REGENDATA ("0.14.1",["github","HTTP.cabal"])
14+
#
15+
name: Haskell-CI
16+
on:
17+
- push
18+
- pull_request
19+
jobs:
20+
linux:
21+
name: Haskell-CI - Linux - ${{ matrix.compiler }}
22+
runs-on: ubuntu-18.04
23+
timeout-minutes:
24+
60
25+
container:
26+
image: buildpack-deps:bionic
27+
continue-on-error: ${{ matrix.allow-failure }}
28+
strategy:
29+
matrix:
30+
include:
31+
- compiler: ghc-9.2.1
32+
compilerKind: ghc
33+
compilerVersion: 9.2.1
34+
setup-method: ghcup
35+
allow-failure: false
36+
- compiler: ghc-9.0.1
37+
compilerKind: ghc
38+
compilerVersion: 9.0.1
39+
setup-method: hvr-ppa
40+
allow-failure: false
41+
- compiler: ghc-8.10.7
42+
compilerKind: ghc
43+
compilerVersion: 8.10.7
44+
setup-method: ghcup
45+
allow-failure: false
46+
- compiler: ghc-8.8.4
47+
compilerKind: ghc
48+
compilerVersion: 8.8.4
49+
setup-method: hvr-ppa
50+
allow-failure: false
51+
- compiler: ghc-8.6.5
52+
compilerKind: ghc
53+
compilerVersion: 8.6.5
54+
setup-method: hvr-ppa
55+
allow-failure: false
56+
- compiler: ghc-8.4.4
57+
compilerKind: ghc
58+
compilerVersion: 8.4.4
59+
setup-method: hvr-ppa
60+
allow-failure: false
61+
- compiler: ghc-8.2.2
62+
compilerKind: ghc
63+
compilerVersion: 8.2.2
64+
setup-method: hvr-ppa
65+
allow-failure: false
66+
- compiler: ghc-8.0.2
67+
compilerKind: ghc
68+
compilerVersion: 8.0.2
69+
setup-method: hvr-ppa
70+
allow-failure: false
71+
- compiler: ghc-7.10.3
72+
compilerKind: ghc
73+
compilerVersion: 7.10.3
74+
setup-method: hvr-ppa
75+
allow-failure: false
76+
- compiler: ghc-7.8.4
77+
compilerKind: ghc
78+
compilerVersion: 7.8.4
79+
setup-method: hvr-ppa
80+
allow-failure: false
81+
- compiler: ghc-7.6.3
82+
compilerKind: ghc
83+
compilerVersion: 7.6.3
84+
setup-method: hvr-ppa
85+
allow-failure: false
86+
- compiler: ghc-7.4.2
87+
compilerKind: ghc
88+
compilerVersion: 7.4.2
89+
setup-method: hvr-ppa
90+
allow-failure: false
91+
- compiler: ghc-7.2.2
92+
compilerKind: ghc
93+
compilerVersion: 7.2.2
94+
setup-method: hvr-ppa
95+
allow-failure: false
96+
- compiler: ghc-7.0.4
97+
compilerKind: ghc
98+
compilerVersion: 7.0.4
99+
setup-method: hvr-ppa
100+
allow-failure: false
101+
fail-fast: false
102+
steps:
103+
- name: apt
104+
run: |
105+
apt-get update
106+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
107+
if [ "${{ matrix.setup-method }}" = ghcup ]; then
108+
mkdir -p "$HOME/.ghcup/bin"
109+
curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
110+
chmod a+x "$HOME/.ghcup/bin/ghcup"
111+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER"
112+
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
113+
else
114+
apt-add-repository -y 'ppa:hvr/ghc'
115+
apt-get update
116+
apt-get install -y "$HCNAME"
117+
mkdir -p "$HOME/.ghcup/bin"
118+
curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
119+
chmod a+x "$HOME/.ghcup/bin/ghcup"
120+
"$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
121+
fi
122+
env:
123+
HCKIND: ${{ matrix.compilerKind }}
124+
HCNAME: ${{ matrix.compiler }}
125+
HCVER: ${{ matrix.compilerVersion }}
126+
- name: Set PATH and environment variables
127+
run: |
128+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
129+
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
130+
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
131+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
132+
HCDIR=/opt/$HCKIND/$HCVER
133+
if [ "${{ matrix.setup-method }}" = ghcup ]; then
134+
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
135+
echo "HC=$HC" >> "$GITHUB_ENV"
136+
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
137+
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
138+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
139+
else
140+
HC=$HCDIR/bin/$HCKIND
141+
echo "HC=$HC" >> "$GITHUB_ENV"
142+
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
143+
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
144+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
145+
fi
146+
147+
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
148+
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
149+
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
150+
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
151+
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
152+
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
153+
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
154+
env:
155+
HCKIND: ${{ matrix.compilerKind }}
156+
HCNAME: ${{ matrix.compiler }}
157+
HCVER: ${{ matrix.compilerVersion }}
158+
- name: env
159+
run: |
160+
env
161+
- name: write cabal config
162+
run: |
163+
mkdir -p $CABAL_DIR
164+
cat >> $CABAL_CONFIG <<EOF
165+
remote-build-reporting: anonymous
166+
write-ghc-environment-files: never
167+
remote-repo-cache: $CABAL_DIR/packages
168+
logs-dir: $CABAL_DIR/logs
169+
world-file: $CABAL_DIR/world
170+
extra-prog-path: $CABAL_DIR/bin
171+
symlink-bindir: $CABAL_DIR/bin
172+
installdir: $CABAL_DIR/bin
173+
build-summary: $CABAL_DIR/logs/build.log
174+
store-dir: $CABAL_DIR/store
175+
install-dirs user
176+
prefix: $CABAL_DIR
177+
repository hackage.haskell.org
178+
url: http://hackage.haskell.org/
179+
EOF
180+
cat >> $CABAL_CONFIG <<EOF
181+
program-default-options
182+
ghc-options: $GHCJOBS +RTS -M3G -RTS
183+
EOF
184+
cat $CABAL_CONFIG
185+
- name: versions
186+
run: |
187+
$HC --version || true
188+
$HC --print-project-git-commit-id || true
189+
$CABAL --version || true
190+
- name: update cabal index
191+
run: |
192+
$CABAL v2-update -v
193+
- name: install cabal-plan
194+
run: |
195+
mkdir -p $HOME/.cabal/bin
196+
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
197+
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
198+
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
199+
rm -f cabal-plan.xz
200+
chmod a+x $HOME/.cabal/bin/cabal-plan
201+
cabal-plan --version
202+
- name: checkout
203+
uses: actions/checkout@v2
204+
with:
205+
path: source
206+
- name: initial cabal.project for sdist
207+
run: |
208+
touch cabal.project
209+
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
210+
cat cabal.project
211+
- name: sdist
212+
run: |
213+
mkdir -p sdist
214+
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
215+
- name: unpack
216+
run: |
217+
mkdir -p unpacked
218+
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
219+
- name: generate cabal.project
220+
run: |
221+
PKGDIR_HTTP="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/HTTP-[0-9.]*')"
222+
echo "PKGDIR_HTTP=${PKGDIR_HTTP}" >> "$GITHUB_ENV"
223+
rm -f cabal.project cabal.project.local
224+
touch cabal.project
225+
touch cabal.project.local
226+
echo "packages: ${PKGDIR_HTTP}" >> cabal.project
227+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package HTTP" >> cabal.project ; fi
228+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
229+
cat >> cabal.project <<EOF
230+
EOF
231+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(HTTP)$/; }' >> cabal.project.local
232+
cat cabal.project
233+
cat cabal.project.local
234+
- name: dump install plan
235+
run: |
236+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
237+
cabal-plan
238+
- name: cache
239+
uses: actions/cache@v2
240+
with:
241+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
242+
path: ~/.cabal/store
243+
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
244+
- name: install dependencies
245+
run: |
246+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
247+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
248+
- name: build w/o tests
249+
run: |
250+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
251+
- name: build
252+
run: |
253+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
254+
- name: tests
255+
run: |
256+
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
257+
- name: cabal check
258+
run: |
259+
cd ${PKGDIR_HTTP} || false
260+
${CABAL} -vnormal check
261+
- name: haddock
262+
run: |
263+
$CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
264+
- name: unconstrained build
265+
run: |
266+
rm -f cabal.project.local
267+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all

HTTP.cabal

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
Cabal-Version: >= 1.10
12
Name: HTTP
23
Version: 4000.3.16
34
x-revision: 1
4-
Cabal-Version: >= 1.10
55
Build-type: Simple
66
License: BSD3
77
License-file: LICENSE
@@ -57,7 +57,10 @@ Description:
5757

5858
Extra-Source-Files: CHANGES
5959

60-
tested-with: GHC==9.0.1, GHC==8.10.4, GHC==8.8.3, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4
60+
tested-with:
61+
GHC==9.2.1, GHC==9.0.1,
62+
GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2,
63+
GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4
6164

6265
Source-Repository head
6366
type: git
@@ -110,23 +113,30 @@ Library
110113

111114
-- note the test harness constraints should be kept in sync with these
112115
-- where dependencies are shared
113-
Build-depends: base >= 4.3.0.0 && < 4.17, parsec >= 2.0 && < 3.2
114-
Build-depends: array >= 0.3.0.2 && < 0.6, bytestring >= 0.9.1.5 && < 0.12
115-
Build-depends: time >= 1.1.2.3 && < 1.13
116+
build-depends:
117+
base >= 4.3.0.0 && < 4.17
118+
, array >= 0.3.0.2 && < 0.6
119+
, bytestring >= 0.9.1.5 && < 0.12
120+
, parsec >= 2.0 && < 3.2
121+
, time >= 1.1.2.3 && < 1.13
122+
-- The following dependencies are refined by flags, but they should
123+
-- still be mentioned here on the top-level.
124+
, mtl >= 1.1.1.0 && < 2.3
125+
, network >= 2.4 && < 3.2
116126

117127
default-language: Haskell98
118128
default-extensions: FlexibleInstances
119129

120130
if flag(mtl1)
121-
Build-depends: mtl >= 1.1.1.0 && < 1.2
131+
Build-depends: mtl < 1.2
122132
CPP-Options: -DMTL1
123133
else
124-
Build-depends: mtl >= 2.0 && < 2.3
134+
Build-depends: mtl >= 2.0
125135

126136
if flag(network-uri)
127-
Build-depends: network-uri == 2.6.*, network >= 2.6 && < 3.2
137+
Build-depends: network-uri == 2.6.*, network >= 2.6
128138
else
129-
Build-depends: network >= 2.4 && < 2.6
139+
Build-depends: network < 2.6
130140

131141
if flag(warn-as-error)
132142
ghc-options: -Werror
@@ -147,37 +157,37 @@ Test-Suite test
147157

148158
ghc-options: -Wall
149159

150-
-- note: version constraints for dependencies shared with the library
151-
-- should be the same
152-
build-depends: HTTP,
153-
HUnit >= 1.2.0.1 && < 1.7,
154-
httpd-shed >= 0.4 && < 0.5,
155-
mtl >= 1.1.1.0 && < 2.3,
156-
bytestring >= 0.9.1.5 && < 0.12,
157-
deepseq >= 1.3.0.0 && < 1.5,
158-
pureMD5 >= 0.2.4 && < 2.2,
159-
base >= 4.3.0.0 && < 4.16,
160-
split >= 0.1.3 && < 0.3,
161-
test-framework >= 0.2.0 && < 0.9,
162-
test-framework-hunit >= 0.3.0 && <0.4
160+
build-depends:
161+
HTTP
162+
-- constraints inherited from HTTP
163+
, base
164+
, bytestring
165+
, mtl
166+
, network
167+
-- extra dependencies
168+
, deepseq >= 1.3.0.0 && < 1.5
169+
, httpd-shed >= 0.4 && < 0.5
170+
, HUnit >= 1.2.0.1 && < 1.7
171+
, pureMD5 >= 0.2.4 && < 2.2
172+
, split >= 0.1.3 && < 0.3
173+
, test-framework >= 0.2.0 && < 0.9
174+
, test-framework-hunit >= 0.3.0 && < 0.4
163175

164176
if flag(network-uri)
165-
Build-depends: network-uri == 2.6.*, network >= 2.6 && < 3.2
177+
Build-depends: network-uri == 2.6.*, network >= 2.6
166178
else
167-
Build-depends: network >= 2.3 && < 2.6
179+
Build-depends: network < 2.6
168180

169181
if flag(warp-tests)
170182
CPP-Options: -DWARP_TESTS
171183
build-depends:
172-
case-insensitive >= 0.4.0.1 && < 1.3,
173-
http-types >= 0.8.0 && < 1.0,
174-
wai >= 2.1.0 && < 3.3,
175-
warp >= 2.1.0 && < 3.4
184+
case-insensitive >= 0.4.0.1 && < 1.3
185+
, conduit >= 1.0.8 && < 1.4
186+
, http-types >= 0.8.0 && < 1.0
187+
, wai >= 2.1.0 && < 3.3
188+
, warp >= 2.1.0 && < 3.4
176189

177190
if flag(conduit10)
178-
build-depends:
179-
conduit >= 1.0.8 && < 1.1
191+
build-depends: conduit < 1.1
180192
else
181-
build-depends:
182-
conduit >= 1.1 && < 1.4,
183-
conduit-extra >= 1.1 && < 1.4
193+
build-depends: conduit >= 1.1, conduit-extra >= 1.1 && < 1.4

0 commit comments

Comments
 (0)