Skip to content

Commit 2a376ed

Browse files
committed
Allow bytestring-0.12; add Haskell CI for GHC 7.10 - 9.8
1 parent e325b30 commit 2a376ed

File tree

3 files changed

+287
-1
lines changed

3 files changed

+287
-1
lines changed

.github/workflows/haskell-ci.yml

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

cabal.haskell-ci

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
branches: master

openssl-streams.cabal

+15-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ Extra-Source-Files: CONTRIBUTORS,
1616
test/cert.pem,
1717
test/key.pem
1818

19+
tested-with:
20+
GHC == 9.8.1
21+
GHC == 9.6.3
22+
GHC == 9.4.7
23+
GHC == 9.2.8
24+
GHC == 9.0.2
25+
GHC == 8.10.7
26+
GHC == 8.8.4
27+
GHC == 8.6.5
28+
GHC == 8.4.4
29+
GHC == 8.2.2
30+
GHC == 8.0.2
31+
GHC == 7.10.3
32+
1933
------------------------------------------------------------------------------
2034
Library
2135
hs-source-dirs: src
@@ -27,7 +41,7 @@ Library
2741
Exposed-modules: System.IO.Streams.SSL
2842

2943
Build-depends: base >= 4 && <5,
30-
bytestring >= 0.9.2 && <0.12,
44+
bytestring >= 0.9.2 && <0.13,
3145
HsOpenSSL >= 0.10.3 && <0.12,
3246
io-streams >= 1.0 && <1.6,
3347
network >= 2.4 && <3.2

0 commit comments

Comments
 (0)