Skip to content

Commit ddc9e75

Browse files
authored
Merge pull request #9 from edsko/edsko/tlc
General maintenance, prepare for release
2 parents 14479b3 + a36cde3 commit ddc9e75

File tree

7 files changed

+89
-56
lines changed

7 files changed

+89
-56
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 51 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,92 @@
11
# This GitHub workflow config has been generated by a script via
22
#
3-
# haskell-ci 'github' 'friendly.cabal'
3+
# haskell-ci 'github' 'cabal.project.ci'
44
#
55
# To regenerate the script (for example after adjusting tested-with) run
66
#
77
# haskell-ci regenerate
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.17.20240109
11+
# version: 0.19.20250710
1212
#
13-
# REGENDATA ("0.17.20240109",["github","friendly.cabal"])
13+
# REGENDATA ("0.19.20250710",["github","cabal.project.ci"])
1414
#
1515
name: Haskell-CI
1616
on:
17-
- push
18-
- pull_request
17+
push:
18+
branches:
19+
- master
20+
pull_request:
21+
branches:
22+
- master
1923
jobs:
2024
linux:
2125
name: Haskell-CI - Linux - ${{ matrix.compiler }}
22-
runs-on: ubuntu-20.04
26+
runs-on: ubuntu-24.04
2327
timeout-minutes:
2428
60
2529
container:
26-
image: buildpack-deps:bionic
30+
image: buildpack-deps:jammy
2731
continue-on-error: ${{ matrix.allow-failure }}
2832
strategy:
2933
matrix:
3034
include:
31-
- compiler: ghc-9.8.1
35+
- compiler: ghc-9.12.2
3236
compilerKind: ghc
33-
compilerVersion: 9.8.1
37+
compilerVersion: 9.12.2
3438
setup-method: ghcup
3539
allow-failure: false
36-
- compiler: ghc-9.6.4
40+
- compiler: ghc-9.10.2
3741
compilerKind: ghc
38-
compilerVersion: 9.6.4
42+
compilerVersion: 9.10.2
3943
setup-method: ghcup
4044
allow-failure: false
41-
- compiler: ghc-9.4.8
45+
- compiler: ghc-9.8.4
4246
compilerKind: ghc
43-
compilerVersion: 9.4.8
47+
compilerVersion: 9.8.4
4448
setup-method: ghcup
4549
allow-failure: false
46-
- compiler: ghc-9.2.8
50+
- compiler: ghc-9.6.7
4751
compilerKind: ghc
48-
compilerVersion: 9.2.8
52+
compilerVersion: 9.6.7
4953
setup-method: ghcup
5054
allow-failure: false
51-
- compiler: ghc-9.0.2
55+
- compiler: ghc-9.4.8
5256
compilerKind: ghc
53-
compilerVersion: 9.0.2
57+
compilerVersion: 9.4.8
5458
setup-method: ghcup
5559
allow-failure: false
56-
- compiler: ghc-8.10.7
60+
- compiler: ghc-9.2.8
5761
compilerKind: ghc
58-
compilerVersion: 8.10.7
62+
compilerVersion: 9.2.8
5963
setup-method: ghcup
6064
allow-failure: false
6165
fail-fast: false
6266
steps:
63-
- name: apt
67+
- name: apt-get install
6468
run: |
6569
apt-get update
6670
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
71+
- name: Install GHCup
72+
run: |
6773
mkdir -p "$HOME/.ghcup/bin"
68-
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
74+
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
6975
chmod a+x "$HOME/.ghcup/bin/ghcup"
76+
- name: Install cabal-install
77+
run: |
78+
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
79+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
80+
- name: Install GHC (GHCup)
81+
if: matrix.setup-method == 'ghcup'
82+
run: |
7083
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
71-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
84+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
85+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
86+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
87+
echo "HC=$HC" >> "$GITHUB_ENV"
88+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
89+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
7290
env:
7391
HCKIND: ${{ matrix.compilerKind }}
7492
HCNAME: ${{ matrix.compiler }}
@@ -79,21 +97,12 @@ jobs:
7997
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
8098
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
8199
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
82-
HCDIR=/opt/$HCKIND/$HCVER
83-
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
84-
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
85-
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
86-
echo "HC=$HC" >> "$GITHUB_ENV"
87-
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
88-
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
89-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
90100
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
91101
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
92102
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
93103
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
94104
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
95105
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
96-
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
97106
env:
98107
HCKIND: ${{ matrix.compilerKind }}
99108
HCNAME: ${{ matrix.compiler }}
@@ -143,7 +152,7 @@ jobs:
143152
chmod a+x $HOME/.cabal/bin/cabal-plan
144153
cabal-plan --version
145154
- name: checkout
146-
uses: actions/checkout@v3
155+
uses: actions/checkout@v4
147156
with:
148157
path: source
149158
- name: initial cabal.project for sdist
@@ -168,18 +177,24 @@ jobs:
168177
touch cabal.project.local
169178
echo "packages: ${PKGDIR_friendly}" >> cabal.project
170179
echo "package friendly" >> cabal.project
171-
echo " ghc-options: -Werror=missing-methods" >> cabal.project
180+
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
181+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package friendly" >> cabal.project ; fi
182+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
183+
echo "package friendly" >> cabal.project
184+
echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project
172185
cat >> cabal.project <<EOF
186+
package friendly
187+
ghc-options: -Werror
173188
EOF
174-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(friendly)$/; }' >> cabal.project.local
189+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(friendly)$/; }' >> cabal.project.local
175190
cat cabal.project
176191
cat cabal.project.local
177192
- name: dump install plan
178193
run: |
179194
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
180195
cabal-plan
181196
- name: restore cache
182-
uses: actions/cache/restore@v3
197+
uses: actions/cache/restore@v4
183198
with:
184199
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
185200
path: ~/.cabal/store
@@ -206,8 +221,8 @@ jobs:
206221
rm -f cabal.project.local
207222
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
208223
- name: save cache
209-
uses: actions/cache/save@v3
210224
if: always()
225+
uses: actions/cache/save@v4
211226
with:
212227
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
213228
path: ~/.cabal/store

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
dist/
21
dist-newstyle/
3-
.ghc.environment.*
42
.envrc

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Revision history for friendly
22

3+
## 0.1.1 -- 2025-07-19
4+
5+
* Relax dependencies
6+
* Drop support for `ghc < 9.2`
7+
38
## 0.1.0.4 -- 2024-01-18
49

510
* Relax bounds (support ghc up to 9.8)

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+
copy-fields: all

cabal.project

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
packages: .
2+
3+
package friendly

cabal.project.ci

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
packages: .
2+
3+
package friendly
4+
ghc-options: -Werror

friendly.cabal

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,42 @@
1+
cabal-version: 2.2
12
name: friendly
2-
version: 0.1.0.4
3+
version: 0.1.1
34
synopsis: Attempt to pretty-print any input
45
description: The friendly executable copies standard input
56
to standard output, attempting to pretty-print the
67
input without actually requiring that the input
78
is well-formed in any way.
8-
license: BSD3
9+
license: BSD-3-Clause
910
license-file: LICENSE
1011
author: Edsko de Vries
1112
maintainer: [email protected]
1213
copyright: Edsko de Vries
1314
category: Development
1415
build-type: Simple
15-
extra-source-files: ChangeLog.md
16-
cabal-version: >=1.10
17-
tested-with: GHC==8.10.7
18-
, GHC==9.0.2
19-
, GHC==9.2.8
20-
, GHC==9.4.8
21-
, GHC==9.6.4
22-
, GHC==9.8.1
16+
extra-doc-files: ChangeLog.md
17+
tested-with: GHC==9.2.8
18+
GHC==9.4.8
19+
GHC==9.6.7
20+
GHC==9.8.4
21+
GHC==9.10.2
22+
GHC==9.12.2
2323

2424
source-repository head
2525
type: git
2626
location: https://github.com/edsko/friendly
2727

28+
common lang
29+
build-depends: base >= 4.16 && < 4.22
30+
default-language: GHC2021
31+
32+
ghc-options:
33+
-Wall
34+
-Wprepositive-qualified-module
35+
-Wredundant-constraints
36+
-Wunused-packages
37+
2838
executable friendly
29-
main-is: Main.hs
30-
build-depends: base >= 4.7 && < 4.20
31-
, bifunctors >= 4.2 && < 5.7
32-
, optparse-applicative >= 0.11 && < 0.19
33-
hs-source-dirs: src
34-
default-language: Haskell2010
35-
default-extensions: MultiWayIf
36-
ghc-options: -Wall
39+
import: lang
40+
main-is: Main.hs
41+
hs-source-dirs: src
42+
build-depends: optparse-applicative >= 0.11 && < 0.20

0 commit comments

Comments
 (0)