Skip to content

Commit b6f5884

Browse files
committed
0.2.5.5 - allower newer text. move CI to github workflow and test with GHC 9.2
1 parent 0e63269 commit b6f5884

5 files changed

Lines changed: 241 additions & 157 deletions

File tree

.github/workflows/haskell-ci.yml

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

.travis.yml

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
reform-happstack [![Hackage](https://img.shields.io/hackage/v/reform-happstack.svg)](https://hackage.haskell.org/package/reform-happstack) [![Build Status](https://api.travis-ci.com/Happstack/reform-happstack.svg?branch=master)](https://travis-ci.com/Happstack/reform-happstack)
1+
reform-happstack [![Hackage](https://img.shields.io/hackage/v/reform-happstack.svg)](https://hackage.haskell.org/package/reform-happstack)
22
=========
33

44
A portable library which provides type-safe form generation and validation. For more information on type-safe forms check out [this section of The Happstack Book](http://www.happstack.com/docs/crashcourse/index.html#type-safe-form-processing-using-reform).

0 commit comments

Comments
 (0)