Skip to content
This repository was archived by the owner on Jul 25, 2022. It is now read-only.

Commit 5498199

Browse files
committed
Haskell-CI on github action for GHC 7.0 - 9.2
1 parent f9df6b2 commit 5498199

File tree

2 files changed

+284
-1
lines changed

2 files changed

+284
-1
lines changed

.github/workflows/haskell-ci.yml

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

ini.cabal

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: >= 1.10
22
name: ini
3-
version: 0.4.2.20220416
3+
version: 0.4.2.1
44
synopsis: Configuration files in the INI format.
55
description: Quick and easy configuration files in the INI format.
66
license: BSD3
@@ -13,6 +13,22 @@ copyright: 2013 Chris Done
1313
category: Data, Configuration
1414
build-type: Simple
1515

16+
tested-with:
17+
GHC == 9.2.2
18+
GHC == 9.0.2
19+
GHC == 8.10.7
20+
GHC == 8.8.4
21+
GHC == 8.6.5
22+
GHC == 8.4.4
23+
GHC == 8.2.2
24+
GHC == 8.0.2
25+
GHC == 7.10.3
26+
GHC == 7.8.4
27+
GHC == 7.6.3
28+
GHC == 7.4.2
29+
GHC == 7.2.2
30+
GHC == 7.0.4
31+
1632
library
1733
hs-source-dirs: src/
1834
exposed-modules: Data.Ini

0 commit comments

Comments
 (0)