Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 51 additions & 36 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -1,74 +1,92 @@
# This GitHub workflow config has been generated by a script via
#
# haskell-ci 'github' 'friendly.cabal'
# haskell-ci 'github' 'cabal.project.ci'
#
# To regenerate the script (for example after adjusting tested-with) run
#
# haskell-ci regenerate
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.17.20240109
# version: 0.19.20250710
#
# REGENDATA ("0.17.20240109",["github","friendly.cabal"])
# REGENDATA ("0.19.20250710",["github","cabal.project.ci"])
#
name: Haskell-CI
on:
- push
- pull_request
push:
branches:
- master
pull_request:
branches:
- master
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
timeout-minutes:
60
container:
image: buildpack-deps:bionic
image: buildpack-deps:jammy
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghc-9.8.1
- compiler: ghc-9.12.2
compilerKind: ghc
compilerVersion: 9.8.1
compilerVersion: 9.12.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.4
- compiler: ghc-9.10.2
compilerKind: ghc
compilerVersion: 9.6.4
compilerVersion: 9.10.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.8
- compiler: ghc-9.8.4
compilerKind: ghc
compilerVersion: 9.4.8
compilerVersion: 9.8.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.8
- compiler: ghc-9.6.7
compilerKind: ghc
compilerVersion: 9.2.8
compilerVersion: 9.6.7
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.0.2
- compiler: ghc-9.4.8
compilerKind: ghc
compilerVersion: 9.0.2
compilerVersion: 9.4.8
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.10.7
- compiler: ghc-9.2.8
compilerKind: ghc
compilerVersion: 8.10.7
compilerVersion: 9.2.8
setup-method: ghcup
allow-failure: false
fail-fast: false
steps:
- name: apt
- name: apt-get install
run: |
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
- name: Install GHCup
run: |
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
- name: Install cabal-install
run: |
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
- name: Install GHC (GHCup)
if: matrix.setup-method == 'ghcup'
run: |
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -79,21 +97,12 @@ jobs:
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand Down Expand Up @@ -143,7 +152,7 @@ jobs:
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: source
- name: initial cabal.project for sdist
Expand All @@ -168,18 +177,24 @@ jobs:
touch cabal.project.local
echo "packages: ${PKGDIR_friendly}" >> cabal.project
echo "package friendly" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package friendly" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
echo "package friendly" >> cabal.project
echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project
cat >> cabal.project <<EOF
package friendly
ghc-options: -Werror
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(friendly)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(friendly)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
cabal-plan
- name: restore cache
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
Expand All @@ -206,8 +221,8 @@ jobs:
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: save cache
uses: actions/cache/save@v3
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
dist/
dist-newstyle/
.ghc.environment.*
.envrc
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Revision history for friendly

## 0.1.1 -- 2025-07-19

* Relax dependencies
* Drop support for `ghc < 9.2`

## 0.1.0.4 -- 2024-01-18

* Relax bounds (support ghc up to 9.8)
Expand Down
2 changes: 2 additions & 0 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
branches: master
copy-fields: all
3 changes: 3 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
packages: .

package friendly
4 changes: 4 additions & 0 deletions cabal.project.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
packages: .

package friendly
ghc-options: -Werror
42 changes: 24 additions & 18 deletions friendly.cabal
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
cabal-version: 2.2
name: friendly
version: 0.1.0.4
version: 0.1.1
synopsis: Attempt to pretty-print any input
description: The friendly executable copies standard input
to standard output, attempting to pretty-print the
input without actually requiring that the input
is well-formed in any way.
license: BSD3
license: BSD-3-Clause
license-file: LICENSE
author: Edsko de Vries
maintainer: edsko@well-typed.com
copyright: Edsko de Vries
category: Development
build-type: Simple
extra-source-files: ChangeLog.md
cabal-version: >=1.10
tested-with: GHC==8.10.7
, GHC==9.0.2
, GHC==9.2.8
, GHC==9.4.8
, GHC==9.6.4
, GHC==9.8.1
extra-doc-files: ChangeLog.md
tested-with: GHC==9.2.8
GHC==9.4.8
GHC==9.6.7
GHC==9.8.4
GHC==9.10.2
GHC==9.12.2

source-repository head
type: git
location: https://github.com/edsko/friendly

common lang
build-depends: base >= 4.16 && < 4.22
default-language: GHC2021

ghc-options:
-Wall
-Wprepositive-qualified-module
-Wredundant-constraints
-Wunused-packages

executable friendly
main-is: Main.hs
build-depends: base >= 4.7 && < 4.20
, bifunctors >= 4.2 && < 5.7
, optparse-applicative >= 0.11 && < 0.19
hs-source-dirs: src
default-language: Haskell2010
default-extensions: MultiWayIf
ghc-options: -Wall
import: lang
main-is: Main.hs
hs-source-dirs: src
build-depends: optparse-applicative >= 0.11 && < 0.20