Skip to content

Commit 7e8b27d

Browse files
authored
Merge pull request #33 from andreasabel/bytestring-0.12
Allow bytestring 0.12 and add CI on Github Actions
2 parents 8a7e0bf + f48aada commit 7e8b27d

File tree

3 files changed

+263
-16
lines changed

3 files changed

+263
-16
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 245 additions & 0 deletions
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' 'GLUT.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.20240106
12+
#
13+
# REGENDATA ("0.17.20240106",["github","GLUT.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: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.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" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
100+
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
101+
apt-get update
102+
apt-get install -y freeglut3-dev
103+
env:
104+
HCKIND: ${{ matrix.compilerKind }}
105+
HCNAME: ${{ matrix.compiler }}
106+
HCVER: ${{ matrix.compilerVersion }}
107+
- name: Set PATH and environment variables
108+
run: |
109+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
110+
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
111+
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
112+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
113+
HCDIR=/opt/$HCKIND/$HCVER
114+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
115+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
116+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
117+
echo "HC=$HC" >> "$GITHUB_ENV"
118+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
119+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
120+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
121+
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
122+
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
123+
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
124+
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
125+
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
126+
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
127+
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
128+
env:
129+
HCKIND: ${{ matrix.compilerKind }}
130+
HCNAME: ${{ matrix.compiler }}
131+
HCVER: ${{ matrix.compilerVersion }}
132+
- name: env
133+
run: |
134+
env
135+
- name: write cabal config
136+
run: |
137+
mkdir -p $CABAL_DIR
138+
cat >> $CABAL_CONFIG <<EOF
139+
remote-build-reporting: anonymous
140+
write-ghc-environment-files: never
141+
remote-repo-cache: $CABAL_DIR/packages
142+
logs-dir: $CABAL_DIR/logs
143+
world-file: $CABAL_DIR/world
144+
extra-prog-path: $CABAL_DIR/bin
145+
symlink-bindir: $CABAL_DIR/bin
146+
installdir: $CABAL_DIR/bin
147+
build-summary: $CABAL_DIR/logs/build.log
148+
store-dir: $CABAL_DIR/store
149+
install-dirs user
150+
prefix: $CABAL_DIR
151+
repository hackage.haskell.org
152+
url: http://hackage.haskell.org/
153+
EOF
154+
cat >> $CABAL_CONFIG <<EOF
155+
program-default-options
156+
ghc-options: $GHCJOBS +RTS -M3G -RTS
157+
EOF
158+
cat $CABAL_CONFIG
159+
- name: versions
160+
run: |
161+
$HC --version || true
162+
$HC --print-project-git-commit-id || true
163+
$CABAL --version || true
164+
- name: update cabal index
165+
run: |
166+
$CABAL v2-update -v
167+
- name: install cabal-plan
168+
run: |
169+
mkdir -p $HOME/.cabal/bin
170+
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
171+
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
172+
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
173+
rm -f cabal-plan.xz
174+
chmod a+x $HOME/.cabal/bin/cabal-plan
175+
cabal-plan --version
176+
- name: checkout
177+
uses: actions/checkout@v4
178+
with:
179+
path: source
180+
- name: initial cabal.project for sdist
181+
run: |
182+
touch cabal.project
183+
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
184+
cat cabal.project
185+
- name: sdist
186+
run: |
187+
mkdir -p sdist
188+
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
189+
- name: unpack
190+
run: |
191+
mkdir -p unpacked
192+
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
193+
- name: generate cabal.project
194+
run: |
195+
PKGDIR_GLUT="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/GLUT-[0-9.]*')"
196+
echo "PKGDIR_GLUT=${PKGDIR_GLUT}" >> "$GITHUB_ENV"
197+
rm -f cabal.project cabal.project.local
198+
touch cabal.project
199+
touch cabal.project.local
200+
echo "packages: ${PKGDIR_GLUT}" >> cabal.project
201+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package GLUT" >> cabal.project ; fi
202+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
203+
cat >> cabal.project <<EOF
204+
EOF
205+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(GLUT)$/; }' >> cabal.project.local
206+
echo "flags: +BuildExamples" >> 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@v3
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_GLUT} || 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@v3
242+
if: always()
243+
with:
244+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
245+
path: ~/.cabal/store

GLUT.cabal

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
cabal-version: >= 1.10
12
name: GLUT
23
version: 2.7.0.16
34
synopsis: A binding for the OpenGL Utility Toolkit
@@ -16,19 +17,18 @@ maintainer: Sven Panne <svenpanne@gmail.com>, Jason Dagit <dagitj@gmail.com>
1617
category: Graphics
1718
build-type: Simple
1819
tested-with:
19-
GHC == 7.0.4
20-
GHC == 7.2.2
21-
GHC == 7.4.2
22-
GHC == 7.6.3
23-
GHC == 7.8.4
24-
GHC == 7.10.3
25-
GHC == 8.0.2
26-
GHC == 8.2.2
27-
GHC == 8.4.3
20+
GHC == 9.8.1
21+
GHC == 9.6.3
22+
GHC == 9.4.8
23+
GHC == 9.2.8
24+
GHC == 9.0.2
25+
GHC == 8.10.7
26+
GHC == 8.8.4
2827
GHC == 8.6.5
29-
GHC == 8.8.1
30-
GHC == 9.6.1
31-
cabal-version: >= 1.10
28+
GHC == 8.4.4
29+
GHC == 8.2.2
30+
GHC == 8.0.2
31+
3232
extra-source-files:
3333
CHANGELOG.md
3434
README.md
@@ -203,7 +203,7 @@ executable Misc-ColorTriangle
203203
buildable: False
204204
main-is: ColorTriangle.hs
205205
other-modules: LoadShaders
206-
build-depends: base >= 3 && < 5, bytestring >= 0.9 && < 0.12, GLUT
206+
build-depends: base >= 3 && < 5, bytestring >= 0.9 && < 0.13, GLUT
207207
hs-source-dirs: examples/Misc/ColorTriangle, examples/RedBook8/common
208208
default-language: Haskell2010
209209
ghc-options: -Wall
@@ -239,7 +239,7 @@ executable Misc-SmoothOpenGL3
239239
if !flag(BuildExamples)
240240
buildable: False
241241
main-is: SmoothOpenGL3.hs
242-
build-depends: base >= 3 && < 5, bytestring >= 0.9 && < 0.12, OpenGLRaw >= 1.0 && < 3.4, GLUT
242+
build-depends: base >= 3 && < 5, bytestring >= 0.9 && < 0.13, OpenGLRaw >= 1.0 && < 3.4, GLUT
243243
hs-source-dirs: examples/Misc
244244
default-language: Haskell2010
245245
ghc-options: -Wall
@@ -257,7 +257,7 @@ executable OrangeBook-Brick
257257
if !flag(BuildExamples)
258258
buildable: False
259259
main-is: Brick.hs
260-
build-depends: base >= 3 && < 5, bytestring >= 0.9 && < 0.12, GLUT
260+
build-depends: base >= 3 && < 5, bytestring >= 0.9 && < 0.13, GLUT
261261
hs-source-dirs: examples/OrangeBook/ogl2brick
262262
default-language: Haskell2010
263263
ghc-options: -Wall
@@ -911,7 +911,7 @@ executable RedBook8-Triangles
911911
buildable: False
912912
main-is: Triangles.hs
913913
other-modules: LoadShaders
914-
build-depends: base >= 3 && < 5, bytestring >= 0.9 && < 0.12, GLUT
914+
build-depends: base >= 3 && < 5, bytestring >= 0.9 && < 0.13, GLUT
915915
hs-source-dirs: examples/RedBook8/Chapter01, examples/RedBook8/common
916916
default-language: Haskell2010
917917
ghc-options: -Wall

cabal.haskell-ci

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
branches: master
2+
apt: freeglut3-dev

0 commit comments

Comments
 (0)