Skip to content

Commit 0e7e648

Browse files
authored
Merge pull request #53 from haskell-github-trust/bump-base
Bump base
2 parents ddf7c1e + ffa7cfe commit 0e7e648

File tree

8 files changed

+372
-209
lines changed

8 files changed

+372
-209
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
# This GitHub workflow config has been generated by a script via
2+
#
3+
# haskell-ci 'github' 'ekg-core.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.19.20240708
12+
#
13+
# REGENDATA ("0.19.20240708",["github","ekg-core.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-20.04
23+
timeout-minutes:
24+
60
25+
container:
26+
image: buildpack-deps:jammy
27+
continue-on-error: ${{ matrix.allow-failure }}
28+
strategy:
29+
matrix:
30+
include:
31+
- compiler: ghc-9.10.1
32+
compilerKind: ghc
33+
compilerVersion: 9.10.1
34+
setup-method: ghcup
35+
allow-failure: false
36+
- compiler: ghc-9.8.2
37+
compilerKind: ghc
38+
compilerVersion: 9.8.2
39+
setup-method: ghcup
40+
allow-failure: false
41+
- compiler: ghc-9.6.6
42+
compilerKind: ghc
43+
compilerVersion: 9.6.6
44+
setup-method: ghcup
45+
allow-failure: false
46+
- compiler: ghc-9.6.4
47+
compilerKind: ghc
48+
compilerVersion: 9.6.4
49+
setup-method: ghcup
50+
allow-failure: false
51+
- compiler: ghc-9.4.8
52+
compilerKind: ghc
53+
compilerVersion: 9.4.8
54+
setup-method: ghcup
55+
allow-failure: false
56+
- compiler: ghc-9.2.8
57+
compilerKind: ghc
58+
compilerVersion: 9.2.8
59+
setup-method: ghcup
60+
allow-failure: false
61+
- compiler: ghc-9.0.2
62+
compilerKind: ghc
63+
compilerVersion: 9.0.2
64+
setup-method: ghcup
65+
allow-failure: false
66+
- compiler: ghc-8.10.7
67+
compilerKind: ghc
68+
compilerVersion: 8.10.7
69+
setup-method: ghcup
70+
allow-failure: false
71+
- compiler: ghc-8.8.3
72+
compilerKind: ghc
73+
compilerVersion: 8.8.3
74+
setup-method: ghcup
75+
allow-failure: false
76+
- compiler: ghc-8.6.5
77+
compilerKind: ghc
78+
compilerVersion: 8.6.5
79+
setup-method: ghcup
80+
allow-failure: false
81+
- compiler: ghc-8.4.4
82+
compilerKind: ghc
83+
compilerVersion: 8.4.4
84+
setup-method: ghcup
85+
allow-failure: false
86+
- compiler: ghc-8.2.2
87+
compilerKind: ghc
88+
compilerVersion: 8.2.2
89+
setup-method: ghcup
90+
allow-failure: false
91+
- compiler: ghc-8.0.2
92+
compilerKind: ghc
93+
compilerVersion: 8.0.2
94+
setup-method: ghcup
95+
allow-failure: false
96+
fail-fast: false
97+
steps:
98+
- name: apt
99+
run: |
100+
apt-get update
101+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
102+
mkdir -p "$HOME/.ghcup/bin"
103+
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
104+
chmod a+x "$HOME/.ghcup/bin/ghcup"
105+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
106+
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
107+
env:
108+
HCKIND: ${{ matrix.compilerKind }}
109+
HCNAME: ${{ matrix.compiler }}
110+
HCVER: ${{ matrix.compilerVersion }}
111+
- name: Set PATH and environment variables
112+
run: |
113+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
114+
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
115+
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
116+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
117+
HCDIR=/opt/$HCKIND/$HCVER
118+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
119+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
120+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
121+
echo "HC=$HC" >> "$GITHUB_ENV"
122+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
123+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
124+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
125+
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
126+
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
127+
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
128+
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
129+
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
130+
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
131+
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
132+
env:
133+
HCKIND: ${{ matrix.compilerKind }}
134+
HCNAME: ${{ matrix.compiler }}
135+
HCVER: ${{ matrix.compilerVersion }}
136+
- name: env
137+
run: |
138+
env
139+
- name: write cabal config
140+
run: |
141+
mkdir -p $CABAL_DIR
142+
cat >> $CABAL_CONFIG <<EOF
143+
remote-build-reporting: anonymous
144+
write-ghc-environment-files: never
145+
remote-repo-cache: $CABAL_DIR/packages
146+
logs-dir: $CABAL_DIR/logs
147+
world-file: $CABAL_DIR/world
148+
extra-prog-path: $CABAL_DIR/bin
149+
symlink-bindir: $CABAL_DIR/bin
150+
installdir: $CABAL_DIR/bin
151+
build-summary: $CABAL_DIR/logs/build.log
152+
store-dir: $CABAL_DIR/store
153+
install-dirs user
154+
prefix: $CABAL_DIR
155+
repository hackage.haskell.org
156+
url: http://hackage.haskell.org/
157+
EOF
158+
cat >> $CABAL_CONFIG <<EOF
159+
program-default-options
160+
ghc-options: $GHCJOBS +RTS -M3G -RTS
161+
EOF
162+
cat $CABAL_CONFIG
163+
- name: versions
164+
run: |
165+
$HC --version || true
166+
$HC --print-project-git-commit-id || true
167+
$CABAL --version || true
168+
- name: update cabal index
169+
run: |
170+
$CABAL v2-update -v
171+
- name: install cabal-plan
172+
run: |
173+
mkdir -p $HOME/.cabal/bin
174+
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
175+
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
176+
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
177+
rm -f cabal-plan.xz
178+
chmod a+x $HOME/.cabal/bin/cabal-plan
179+
cabal-plan --version
180+
- name: checkout
181+
uses: actions/checkout@v4
182+
with:
183+
path: source
184+
- name: initial cabal.project for sdist
185+
run: |
186+
touch cabal.project
187+
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
188+
cat cabal.project
189+
- name: sdist
190+
run: |
191+
mkdir -p sdist
192+
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
193+
- name: unpack
194+
run: |
195+
mkdir -p unpacked
196+
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
197+
- name: generate cabal.project
198+
run: |
199+
PKGDIR_ekg_core="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/ekg-core-[0-9.]*')"
200+
echo "PKGDIR_ekg_core=${PKGDIR_ekg_core}" >> "$GITHUB_ENV"
201+
rm -f cabal.project cabal.project.local
202+
touch cabal.project
203+
touch cabal.project.local
204+
echo "packages: ${PKGDIR_ekg_core}" >> cabal.project
205+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package ekg-core" >> cabal.project ; fi
206+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
207+
cat >> cabal.project <<EOF
208+
EOF
209+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(ekg-core)$/; }' >> cabal.project.local
210+
cat cabal.project
211+
cat cabal.project.local
212+
- name: dump install plan
213+
run: |
214+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
215+
cabal-plan
216+
- name: restore cache
217+
uses: actions/cache/restore@v4
218+
with:
219+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
220+
path: ~/.cabal/store
221+
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
222+
- name: install dependencies
223+
run: |
224+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
225+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
226+
- name: build w/o tests
227+
run: |
228+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
229+
- name: build
230+
run: |
231+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
232+
- name: cabal check
233+
run: |
234+
cd ${PKGDIR_ekg_core} || false
235+
${CABAL} -vnormal check
236+
- name: haddock
237+
run: |
238+
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
239+
- name: unconstrained build
240+
run: |
241+
rm -f cabal.project.local
242+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
243+
- name: save cache
244+
uses: actions/cache/save@v4
245+
if: always()
246+
with:
247+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
248+
path: ~/.cabal/store

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ cabal.config
1111
cabal.sandbox.config
1212
examples/Group
1313
*.sublime-*
14+
dist-newstyle/

0 commit comments

Comments
 (0)