Skip to content

Commit b7d5e82

Browse files
committed
CI: Get it running again
1 parent abbb8e8 commit b7d5e82

2 files changed

Lines changed: 252 additions & 14 deletions

File tree

.github/workflows/haskell-ci.yml

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

http-proxy.cabal

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ cabal-version: >= 1.10
1212
stability: Experimental
1313
extra-source-files: ChangeLog.md Readme.md
1414

15+
tested-with:
16+
GHC == 8.10.7 || == 9.0.2 || == 9.2.8 || == 9.4.8 || == 9.6.7 || == 9.8.4
17+
|| == 9.10.7 || == 9.12.2 || == 9.14.1
18+
1519
synopsis: A library for writing HTTP and HTTPS proxies
1620

1721
description:
@@ -32,7 +36,7 @@ source-repository head
3236

3337
library
3438
default-language: Haskell2010
35-
ghc-options: -Wall -fwarn-tabs
39+
ghc-options: -Wall -Wunused-packages
3640
if os(windows)
3741
cpp-options: -DWINDOWS
3842

@@ -42,30 +46,22 @@ library
4246
build-depends: base >= 4 && < 5
4347
, async == 2.2.*
4448
, bytestring >= 0.10.8
45-
, bytestring-lexing >= 0.5
4649
, case-insensitive >= 1.2
4750
, conduit == 1.3.*
4851
, conduit-extra == 1.3.*
4952
, http-client >= 0.6 && < 0.8
5053
, http-conduit == 2.3.*
5154
, http-types == 0.12.*
52-
, mtl >= 2.2 && < 2.4
5355
, network >= 3.1
54-
, resourcet >= 1.2 && < 1.4
55-
, streaming-commons == 0.2.*
56-
, tls >= 1.5 && < 2.3
57-
, text >= 2.0 && < 2.2
58-
, transformers >= 0.5 && < 0.7
5956
, wai == 3.2.*
6057
, wai-conduit == 3.0.*
6158
, warp >= 3.3 && < 3.5
62-
, warp-tls >= 3.3 && < 3.5
6359

6460

6561

6662
test-suite test
6763
type: exitcode-stdio-1.0
68-
ghc-options: -Wall -fwarn-tabs -threaded -rtsopts "-with-rtsopts=-H1m -K1m"
64+
ghc-options: -Wall -Wunused-packages -threaded -rtsopts "-with-rtsopts=-H1m -K1m"
6965
if os(windows)
7066
cpp-options: -DWINDOWS
7167
default-language: Haskell2010
@@ -83,7 +79,7 @@ test-suite test
8379
, async
8480
, blaze-builder
8581
, bytestring
86-
, bytestring-lexing
82+
, bytestring-lexing >= 0.5
8783
, case-insensitive
8884
, conduit
8985
, connection >= 0.2
@@ -106,7 +102,7 @@ test-suite test
106102

107103
test-suite test-io
108104
type: exitcode-stdio-1.0
109-
ghc-options: -Wall -fwarn-tabs -threaded -rtsopts "-with-rtsopts=-H1m -K1m"
105+
ghc-options: -Wall -Wunused-packages -threaded -rtsopts "-with-rtsopts=-H1m -K1m"
110106
if os(windows)
111107
cpp-options: -DWINDOWS
112108
default-language: Haskell2010
@@ -147,7 +143,7 @@ test-suite test-io
147143

148144
executable request-rewrite-proxy
149145
default-language: Haskell2010
150-
ghc-options: -Wall -fwarn-tabs -threaded -rtsopts "-with-rtsopts=-H1m -K1m"
146+
ghc-options: -Wall -Wunused-packages -threaded -rtsopts "-with-rtsopts=-H1m -K1m"
151147
hs-source-dirs: examples
152148
main-is: request-rewrite-proxy.hs
153149

@@ -159,7 +155,7 @@ executable request-rewrite-proxy
159155

160156
executable simple-proxy
161157
default-language: Haskell2010
162-
ghc-options: -Wall -fwarn-tabs -threaded -rtsopts "-with-rtsopts=-H1m -K1m"
158+
ghc-options: -Wall -Wunused-packages -threaded -rtsopts "-with-rtsopts=-H1m -K1m"
163159
hs-source-dirs: examples
164160
main-is: simple-proxy.hs
165161

0 commit comments

Comments
 (0)