Skip to content

Commit 5fb424b

Browse files
authored
Merge pull request #96 from andreasabel/ghc-9.8
Bump dependencies for GHC 9.8; add CI on Github Actions
2 parents d2fda36 + c9df09d commit 5fb424b

File tree

3 files changed

+261
-8
lines changed

3 files changed

+261
-8
lines changed

.github/workflows/haskell-ci.yml

+245
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
# This GitHub workflow config has been generated by a script via
2+
#
3+
# haskell-ci 'github' 'OpenGL.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.19.20240422
12+
#
13+
# REGENDATA ("0.19.20240422",["github","OpenGL.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-22.04
27+
timeout-minutes:
28+
60
29+
container:
30+
image: buildpack-deps:jammy
31+
continue-on-error: ${{ matrix.allow-failure }}
32+
strategy:
33+
matrix:
34+
include:
35+
- compiler: ghc-9.8.2
36+
compilerKind: ghc
37+
compilerVersion: 9.8.2
38+
setup-method: ghcup
39+
allow-failure: false
40+
- compiler: ghc-9.6.5
41+
compilerKind: ghc
42+
compilerVersion: 9.6.5
43+
setup-method: ghcup
44+
allow-failure: false
45+
- compiler: ghc-9.4.8
46+
compilerKind: ghc
47+
compilerVersion: 9.4.8
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.20.0/x86_64-linux-ghcup-0.1.20.0 > "$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.8.yaml;
100+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
101+
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.3.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
102+
apt-get update
103+
apt-get install -y freeglut3-dev
104+
env:
105+
HCKIND: ${{ matrix.compilerKind }}
106+
HCNAME: ${{ matrix.compiler }}
107+
HCVER: ${{ matrix.compilerVersion }}
108+
- name: Set PATH and environment variables
109+
run: |
110+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
111+
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
112+
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
113+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
114+
HCDIR=/opt/$HCKIND/$HCVER
115+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
116+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
117+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
118+
echo "HC=$HC" >> "$GITHUB_ENV"
119+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
120+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
121+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.3.0 -vnormal+nowrap" >> "$GITHUB_ENV"
122+
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
123+
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
124+
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
125+
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
126+
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
127+
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
128+
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
129+
env:
130+
HCKIND: ${{ matrix.compilerKind }}
131+
HCNAME: ${{ matrix.compiler }}
132+
HCVER: ${{ matrix.compilerVersion }}
133+
- name: env
134+
run: |
135+
env
136+
- name: write cabal config
137+
run: |
138+
mkdir -p $CABAL_DIR
139+
cat >> $CABAL_CONFIG <<EOF
140+
remote-build-reporting: anonymous
141+
write-ghc-environment-files: never
142+
remote-repo-cache: $CABAL_DIR/packages
143+
logs-dir: $CABAL_DIR/logs
144+
world-file: $CABAL_DIR/world
145+
extra-prog-path: $CABAL_DIR/bin
146+
symlink-bindir: $CABAL_DIR/bin
147+
installdir: $CABAL_DIR/bin
148+
build-summary: $CABAL_DIR/logs/build.log
149+
store-dir: $CABAL_DIR/store
150+
install-dirs user
151+
prefix: $CABAL_DIR
152+
repository hackage.haskell.org
153+
url: http://hackage.haskell.org/
154+
EOF
155+
cat >> $CABAL_CONFIG <<EOF
156+
program-default-options
157+
ghc-options: $GHCJOBS +RTS -M3G -RTS
158+
EOF
159+
cat $CABAL_CONFIG
160+
- name: versions
161+
run: |
162+
$HC --version || true
163+
$HC --print-project-git-commit-id || true
164+
$CABAL --version || true
165+
- name: update cabal index
166+
run: |
167+
$CABAL v2-update -v
168+
- name: install cabal-plan
169+
run: |
170+
mkdir -p $HOME/.cabal/bin
171+
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
172+
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
173+
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
174+
rm -f cabal-plan.xz
175+
chmod a+x $HOME/.cabal/bin/cabal-plan
176+
cabal-plan --version
177+
- name: checkout
178+
uses: actions/checkout@v4
179+
with:
180+
path: source
181+
- name: initial cabal.project for sdist
182+
run: |
183+
touch cabal.project
184+
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
185+
cat cabal.project
186+
- name: sdist
187+
run: |
188+
mkdir -p sdist
189+
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
190+
- name: unpack
191+
run: |
192+
mkdir -p unpacked
193+
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
194+
- name: generate cabal.project
195+
run: |
196+
PKGDIR_OpenGL="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/OpenGL-[0-9.]*')"
197+
echo "PKGDIR_OpenGL=${PKGDIR_OpenGL}" >> "$GITHUB_ENV"
198+
rm -f cabal.project cabal.project.local
199+
touch cabal.project
200+
touch cabal.project.local
201+
echo "packages: ${PKGDIR_OpenGL}" >> cabal.project
202+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package OpenGL" >> cabal.project ; fi
203+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
204+
cat >> cabal.project <<EOF
205+
EOF
206+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(OpenGL)$/; }' >> cabal.project.local
207+
cat cabal.project
208+
cat cabal.project.local
209+
- name: dump install plan
210+
run: |
211+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
212+
cabal-plan
213+
- name: restore cache
214+
uses: actions/cache/restore@v4
215+
with:
216+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
217+
path: ~/.cabal/store
218+
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
219+
- name: install dependencies
220+
run: |
221+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
222+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
223+
- name: build w/o tests
224+
run: |
225+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
226+
- name: build
227+
run: |
228+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
229+
- name: cabal check
230+
run: |
231+
cd ${PKGDIR_OpenGL} || false
232+
${CABAL} -vnormal check
233+
- name: haddock
234+
run: |
235+
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
236+
- name: unconstrained build
237+
run: |
238+
rm -f cabal.project.local
239+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
240+
- name: save cache
241+
uses: actions/cache/save@v4
242+
if: always()
243+
with:
244+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
245+
path: ~/.cabal/store

OpenGL.cabal

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
cabal-version: >= 1.10
12
name: OpenGL
23
version: 3.0.3.0
34
synopsis: A binding for the OpenGL graphics system
@@ -20,15 +21,20 @@ author: Sven Panne
2021
maintainer: Sven Panne <[email protected]>, Jason Dagit <[email protected]>
2122
category: Graphics
2223
build-type: Simple
24+
2325
tested-with:
24-
GHC == 7.8.4
25-
GHC == 7.10.3
26-
GHC == 8.0.2
27-
GHC == 8.2.2
28-
GHC == 8.4.3
26+
GHC == 9.8.2
27+
GHC == 9.6.5
28+
GHC == 9.4.8
29+
GHC == 9.2.8
30+
GHC == 9.0.2
31+
GHC == 8.10.7
32+
GHC == 8.8.4
2933
GHC == 8.6.5
30-
GHC == 8.8.1
31-
cabal-version: >= 1.10
34+
GHC == 8.4.4
35+
GHC == 8.2.2
36+
GHC == 8.0.2
37+
3238
extra-source-files:
3339
CHANGELOG.md
3440
README.md
@@ -159,7 +165,7 @@ library
159165
if impl(ghc > 8)
160166
ghc-options: -Wcompat
161167
build-depends:
162-
base >= 3 && < 5,
168+
base >= 4 && < 5,
163169
bytestring >= 0.9 && < 0.13,
164170
containers >= 0.3 && < 0.8,
165171
text >= 0.1 && < 2.2,

cabal.haskell-ci

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
branches: master
2+
apt: freeglut3-dev

0 commit comments

Comments
 (0)