Skip to content

Commit 3d063ab

Browse files
authored
Merge pull request #46 from haskell-servant/maksbotan/lens-5
GH Actions, GHC 8.10, lens 5
2 parents e7bb9e7 + 1b945b2 commit 3d063ab

File tree

3 files changed

+199
-157
lines changed

3 files changed

+199
-157
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
# This GitHub workflow config has been generated by a script via
2+
#
3+
# haskell-ci 'github' '--config' 'cabal.haskell-ci' 'servant-js.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.12
12+
#
13+
# REGENDATA ("0.12",["github","--config","cabal.haskell-ci","servant-js.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-18.04
27+
container:
28+
image: buildpack-deps:bionic
29+
continue-on-error: ${{ matrix.allow-failure }}
30+
strategy:
31+
matrix:
32+
include:
33+
- compiler: ghc-8.10.4
34+
allow-failure: false
35+
- compiler: ghc-8.8.4
36+
allow-failure: false
37+
- compiler: ghc-8.6.5
38+
allow-failure: false
39+
- compiler: ghc-8.4.4
40+
allow-failure: false
41+
- compiler: ghc-8.2.2
42+
allow-failure: false
43+
- compiler: ghc-8.0.2
44+
allow-failure: false
45+
fail-fast: false
46+
steps:
47+
- name: apt
48+
run: |
49+
apt-get update
50+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common
51+
apt-add-repository -y 'ppa:hvr/ghc'
52+
apt-get update
53+
apt-get install -y $CC cabal-install-3.4
54+
env:
55+
CC: ${{ matrix.compiler }}
56+
- name: Set PATH and environment variables
57+
run: |
58+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
59+
echo "LANG=C.UTF-8" >> $GITHUB_ENV
60+
echo "CABAL_DIR=$HOME/.cabal" >> $GITHUB_ENV
61+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> $GITHUB_ENV
62+
HCDIR=$(echo "/opt/$CC" | sed 's/-/\//')
63+
HCNAME=ghc
64+
HC=$HCDIR/bin/$HCNAME
65+
echo "HC=$HC" >> $GITHUB_ENV
66+
echo "HCPKG=$HCDIR/bin/$HCNAME-pkg" >> $GITHUB_ENV
67+
echo "HADDOCK=$HCDIR/bin/haddock" >> $GITHUB_ENV
68+
echo "CABAL=/opt/cabal/3.4/bin/cabal -vnormal+nowrap" >> $GITHUB_ENV
69+
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
70+
echo "HCNUMVER=$HCNUMVER" >> $GITHUB_ENV
71+
if [ $((HCNUMVER < 80800)) -ne 0 ] ; then echo "ARG_TESTS=--enable-tests" >> $GITHUB_ENV ; else echo "ARG_TESTS=--disable-tests" >> $GITHUB_ENV ; fi
72+
echo "ARG_BENCH=--enable-benchmarks" >> $GITHUB_ENV
73+
echo "HEADHACKAGE=false" >> $GITHUB_ENV
74+
echo "ARG_COMPILER=--$HCNAME --with-compiler=$HC" >> $GITHUB_ENV
75+
echo "GHCJSARITH=0" >> $GITHUB_ENV
76+
env:
77+
CC: ${{ matrix.compiler }}
78+
- name: env
79+
run: |
80+
env
81+
- name: write cabal config
82+
run: |
83+
mkdir -p $CABAL_DIR
84+
cat >> $CABAL_CONFIG <<EOF
85+
remote-build-reporting: anonymous
86+
write-ghc-environment-files: never
87+
remote-repo-cache: $CABAL_DIR/packages
88+
logs-dir: $CABAL_DIR/logs
89+
world-file: $CABAL_DIR/world
90+
extra-prog-path: $CABAL_DIR/bin
91+
symlink-bindir: $CABAL_DIR/bin
92+
installdir: $CABAL_DIR/bin
93+
build-summary: $CABAL_DIR/logs/build.log
94+
store-dir: $CABAL_DIR/store
95+
install-dirs user
96+
prefix: $CABAL_DIR
97+
repository hackage.haskell.org
98+
url: http://hackage.haskell.org/
99+
EOF
100+
cat $CABAL_CONFIG
101+
- name: versions
102+
run: |
103+
$HC --version || true
104+
$HC --print-project-git-commit-id || true
105+
$CABAL --version || true
106+
- name: update cabal index
107+
run: |
108+
$CABAL v2-update -v
109+
- name: install cabal-plan
110+
run: |
111+
mkdir -p $HOME/.cabal/bin
112+
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
113+
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
114+
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
115+
rm -f cabal-plan.xz
116+
chmod a+x $HOME/.cabal/bin/cabal-plan
117+
cabal-plan --version
118+
- name: checkout
119+
uses: actions/checkout@v2
120+
with:
121+
path: source
122+
- name: initial cabal.project for sdist
123+
run: |
124+
touch cabal.project
125+
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
126+
cat cabal.project
127+
- name: sdist
128+
run: |
129+
mkdir -p sdist
130+
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
131+
- name: unpack
132+
run: |
133+
mkdir -p unpacked
134+
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
135+
- name: generate cabal.project
136+
run: |
137+
PKGDIR_servant_js="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/servant-js-[0-9.]*')"
138+
echo "PKGDIR_servant_js=${PKGDIR_servant_js}" >> $GITHUB_ENV
139+
touch cabal.project
140+
touch cabal.project.local
141+
echo "packages: ${PKGDIR_servant_js}" >> cabal.project
142+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package servant-js" >> cabal.project ; fi
143+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
144+
cat >> cabal.project <<EOF
145+
EOF
146+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(servant-js)$/; }' >> cabal.project.local
147+
cat cabal.project
148+
cat cabal.project.local
149+
- name: dump install plan
150+
run: |
151+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
152+
cabal-plan
153+
- name: cache
154+
uses: actions/cache@v2
155+
with:
156+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
157+
path: ~/.cabal/store
158+
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
159+
- name: install dependencies
160+
run: |
161+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
162+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
163+
- name: build w/o tests
164+
run: |
165+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
166+
- name: build
167+
run: |
168+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
169+
- name: tests
170+
run: |
171+
if [ $((HCNUMVER < 80800)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct ; fi
172+
- name: cabal check
173+
run: |
174+
cd ${PKGDIR_servant_js} || false
175+
${CABAL} -vnormal check
176+
- name: haddock
177+
run: |
178+
$CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
179+
- name: unconstrained build
180+
run: |
181+
rm -f cabal.project.local
182+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
183+
- name: prepare for constraint sets
184+
run: |
185+
rm -f cabal.project.local
186+
- name: constraint set servant-0.17
187+
run: |
188+
if [ $((HCNUMVER < 81000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.17.*' all ; fi
189+
- name: constraint set servant-0.16
190+
run: |
191+
if [ $((HCNUMVER < 81000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.16.*' all ; fi
192+
- name: constraint set servant-0.15
193+
run: |
194+
if [ $((HCNUMVER < 80800)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.15.*' all ; fi

.travis.yml

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

servant-js.cabal

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ tested-with:
2828
|| ==8.2.2
2929
|| ==8.4.4
3030
|| ==8.6.5
31-
|| ==8.8.1
31+
|| ==8.8.4
32+
|| ==8.10.4
3233

3334
extra-source-files:
3435
include/*.h
@@ -50,12 +51,12 @@ library
5051
Servant.JS.Internal
5152
Servant.JS.JQuery
5253
Servant.JS.Vanilla
53-
build-depends: base >= 4.9 && <4.15
54+
build-depends: base >= 4.9 && <4.16
5455
, base-compat >= 0.10.5 && <0.12
5556
, charset >= 0.3.7.1 && <0.4
56-
, lens >= 4.17 && <4.20
57+
, lens >= 4.17 && <5.1
5758
, servant-foreign >= 0.15 && <0.16
58-
, servant >= 0.15 && <0.18
59+
, servant >= 0.15 && <0.19
5960
, text >= 1.2.3.0 && < 1.3
6061

6162
hs-source-dirs: src

0 commit comments

Comments
 (0)