diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index c2781ab..68c1223 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -1,6 +1,6 @@ # 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 # @@ -8,67 +8,85 @@ # # 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 }} @@ -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 }} @@ -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 @@ -168,10 +177,16 @@ 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 <> 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 @@ -179,7 +194,7 @@ jobs: $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 @@ -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 diff --git a/.gitignore b/.gitignore index 2566a14..11bc335 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,2 @@ -dist/ dist-newstyle/ -.ghc.environment.* .envrc diff --git a/ChangeLog.md b/ChangeLog.md index 3e281ee..f3a9d6c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -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) diff --git a/cabal.haskell-ci b/cabal.haskell-ci new file mode 100644 index 0000000..7a1f9ae --- /dev/null +++ b/cabal.haskell-ci @@ -0,0 +1,2 @@ +branches: master +copy-fields: all diff --git a/cabal.project b/cabal.project new file mode 100644 index 0000000..6b8f58f --- /dev/null +++ b/cabal.project @@ -0,0 +1,3 @@ +packages: . + +package friendly diff --git a/cabal.project.ci b/cabal.project.ci new file mode 100644 index 0000000..0660f94 --- /dev/null +++ b/cabal.project.ci @@ -0,0 +1,4 @@ +packages: . + +package friendly + ghc-options: -Werror diff --git a/friendly.cabal b/friendly.cabal index ba4df4d..d87341f 100644 --- a/friendly.cabal +++ b/friendly.cabal @@ -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