Skip to content

Commit 4ba8708

Browse files
andreasabelerikd
authored andcommitted
Allow primitive-0.9; add Haskell CI for GHC 7.10 - 9.8
Includes the bound changes made to `primitive` in revisions 1 and 2. Tests only build with GHC 8.0 and up; reflected this in the `base` lower bound. Removed old Travis CI.
1 parent 5ebd01c commit 4ba8708

File tree

4 files changed

+294
-37
lines changed

4 files changed

+294
-37
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 271 additions & 0 deletions
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' 'vector-algorithms.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","vector-algorithms.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+
if [ $((HCNUMVER >= 80000)) -ne 0 ] ; then echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" ; else echo "ARG_TESTS=--disable-tests" >> "$GITHUB_ENV" ; fi
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_vector_algorithms="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/vector-algorithms-[0-9.]*')"
220+
echo "PKGDIR_vector_algorithms=${PKGDIR_vector_algorithms}" >> "$GITHUB_ENV"
221+
rm -f cabal.project cabal.project.local
222+
touch cabal.project
223+
touch cabal.project.local
224+
echo "packages: ${PKGDIR_vector_algorithms}" >> cabal.project
225+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package vector-algorithms" >> 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 /^(vector-algorithms)$/; }' >> 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+
if [ $((HCNUMVER >= 80000)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct ; fi
255+
- name: cabal check
256+
run: |
257+
cd ${PKGDIR_vector_algorithms} || 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

.travis.yml

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

cabal.haskell-ci

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
branches: master
2+
3+
-- Tests fail to build with GHC 7.10
4+
tests: >= 8.0

vector-algorithms.cabal

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
cabal-version: >= 1.10
12
name: vector-algorithms
23
version: 0.9.0.1
34
license: BSD3
@@ -13,9 +14,22 @@ synopsis: Efficient algorithms for vector arrays
1314
description: Efficient algorithms for sorting vector arrays. At some stage
1415
other vector algorithms may be added.
1516
build-type: Simple
16-
cabal-version: >= 1.10
17+
1718
extra-source-files: CHANGELOG.md
1819

20+
tested-with:
21+
GHC == 9.8.1
22+
GHC == 9.6.3
23+
GHC == 9.4.7
24+
GHC == 9.2.8
25+
GHC == 9.0.2
26+
GHC == 8.10.7
27+
GHC == 8.8.4
28+
GHC == 8.6.5
29+
GHC == 8.4.4
30+
GHC == 8.2.2
31+
GHC == 8.0.2
32+
GHC == 7.10.3
1933

2034
flag BoundsChecks
2135
description: Enable bounds checking
@@ -56,11 +70,11 @@ library
5670
hs-source-dirs: src
5771
default-language: Haskell2010
5872

59-
build-depends: base >= 4.5 && < 5,
73+
build-depends: base >= 4.8 && < 5,
6074
bitvec >= 1.0 && < 1.2,
6175
vector >= 0.6 && < 0.14,
62-
primitive >=0.3 && <0.9,
63-
bytestring >= 0.9 && < 1.0
76+
primitive >= 0.6.2.0 && < 0.10,
77+
bytestring >= 0.9 && < 1
6478

6579
if ! impl (ghc >= 7.8)
6680
build-depends: tagged >= 0.4 && < 0.9
@@ -143,7 +157,7 @@ test-suite properties
143157
buildable: False
144158
else
145159
build-depends:
146-
base,
160+
base >= 4.9,
147161
bytestring,
148162
containers,
149163
QuickCheck > 2.9 && < 2.15,
@@ -152,4 +166,3 @@ test-suite properties
152166

153167
if flag(llvm)
154168
ghc-options: -fllvm
155-

0 commit comments

Comments
 (0)