Skip to content

Commit 4db21b4

Browse files
committed
Merge branch 'patch-force-timeout'
2 parents a6add06 + 314aa12 commit 4db21b4

16 files changed

Lines changed: 418 additions & 258 deletions

File tree

.github/workflows/haskell-ci.yml

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
# This GitHub workflow config has been generated by a script via
2+
#
3+
# haskell-ci 'github' 'happstack-server.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.20231012
12+
#
13+
# REGENDATA ("0.17.20231012",["github","happstack-server.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: ghcup
69+
allow-failure: false
70+
- compiler: ghc-8.6.5
71+
compilerKind: ghc
72+
compilerVersion: 8.6.5
73+
setup-method: ghcup
74+
allow-failure: false
75+
- compiler: ghc-8.4.4
76+
compilerKind: ghc
77+
compilerVersion: 8.4.4
78+
setup-method: ghcup
79+
allow-failure: false
80+
- compiler: ghc-8.2.2
81+
compilerKind: ghc
82+
compilerVersion: 8.2.2
83+
setup-method: ghcup
84+
allow-failure: false
85+
- compiler: ghc-8.0.2
86+
compilerKind: ghc
87+
compilerVersion: 8.0.2
88+
setup-method: ghcup
89+
allow-failure: false
90+
fail-fast: false
91+
steps:
92+
- name: apt
93+
run: |
94+
apt-get update
95+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
96+
mkdir -p "$HOME/.ghcup/bin"
97+
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
98+
chmod a+x "$HOME/.ghcup/bin/ghcup"
99+
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
100+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
101+
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
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+
HCDIR=/opt/$HCKIND/$HCVER
113+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
114+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
115+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
116+
echo "HC=$HC" >> "$GITHUB_ENV"
117+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
118+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
119+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
120+
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
121+
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
122+
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
123+
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
124+
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
125+
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
126+
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
127+
env:
128+
HCKIND: ${{ matrix.compilerKind }}
129+
HCNAME: ${{ matrix.compiler }}
130+
HCVER: ${{ matrix.compilerVersion }}
131+
- name: env
132+
run: |
133+
env
134+
- name: write cabal config
135+
run: |
136+
mkdir -p $CABAL_DIR
137+
cat >> $CABAL_CONFIG <<EOF
138+
remote-build-reporting: anonymous
139+
write-ghc-environment-files: never
140+
remote-repo-cache: $CABAL_DIR/packages
141+
logs-dir: $CABAL_DIR/logs
142+
world-file: $CABAL_DIR/world
143+
extra-prog-path: $CABAL_DIR/bin
144+
symlink-bindir: $CABAL_DIR/bin
145+
installdir: $CABAL_DIR/bin
146+
build-summary: $CABAL_DIR/logs/build.log
147+
store-dir: $CABAL_DIR/store
148+
install-dirs user
149+
prefix: $CABAL_DIR
150+
repository hackage.haskell.org
151+
url: http://hackage.haskell.org/
152+
EOF
153+
cat >> $CABAL_CONFIG <<EOF
154+
program-default-options
155+
ghc-options: $GHCJOBS +RTS -M3G -RTS
156+
EOF
157+
cat $CABAL_CONFIG
158+
- name: versions
159+
run: |
160+
$HC --version || true
161+
$HC --print-project-git-commit-id || true
162+
$CABAL --version || true
163+
- name: update cabal index
164+
run: |
165+
$CABAL v2-update -v
166+
- name: install cabal-plan
167+
run: |
168+
mkdir -p $HOME/.cabal/bin
169+
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
170+
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
171+
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
172+
rm -f cabal-plan.xz
173+
chmod a+x $HOME/.cabal/bin/cabal-plan
174+
cabal-plan --version
175+
- name: checkout
176+
uses: actions/checkout@v4
177+
with:
178+
path: source
179+
- name: initial cabal.project for sdist
180+
run: |
181+
touch cabal.project
182+
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
183+
cat cabal.project
184+
- name: sdist
185+
run: |
186+
mkdir -p sdist
187+
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
188+
- name: unpack
189+
run: |
190+
mkdir -p unpacked
191+
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
192+
- name: generate cabal.project
193+
run: |
194+
PKGDIR_happstack_server="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/happstack-server-[0-9.]*')"
195+
echo "PKGDIR_happstack_server=${PKGDIR_happstack_server}" >> "$GITHUB_ENV"
196+
rm -f cabal.project cabal.project.local
197+
touch cabal.project
198+
touch cabal.project.local
199+
echo "packages: ${PKGDIR_happstack_server}" >> cabal.project
200+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package happstack-server" >> cabal.project ; fi
201+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
202+
cat >> cabal.project <<EOF
203+
EOF
204+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(happstack-server)$/; }' >> cabal.project.local
205+
cat cabal.project
206+
cat cabal.project.local
207+
- name: dump install plan
208+
run: |
209+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
210+
cabal-plan
211+
- name: restore cache
212+
uses: actions/cache/restore@v3
213+
with:
214+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
215+
path: ~/.cabal/store
216+
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
217+
- name: install dependencies
218+
run: |
219+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
220+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
221+
- name: build w/o tests
222+
run: |
223+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
224+
- name: build
225+
run: |
226+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
227+
- name: tests
228+
run: |
229+
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
230+
- name: cabal check
231+
run: |
232+
cd ${PKGDIR_happstack_server} || false
233+
${CABAL} -vnormal check
234+
- name: haddock
235+
run: |
236+
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
237+
- name: unconstrained build
238+
run: |
239+
rm -f cabal.project.local
240+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
241+
- name: save cache
242+
uses: actions/cache/save@v3
243+
if: always()
244+
with:
245+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
246+
path: ~/.cabal/store

.travis.yml

Lines changed: 0 additions & 152 deletions
This file was deleted.

0 commit comments

Comments
 (0)