From 5cbc5bd50111725f41c5376ca91a997a500fba18 Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Sun, 19 May 2024 10:50:08 -0500 Subject: [PATCH] Add support for GHC 9.10, remove support for GHC 9.4 (#17) * Upgrade to GHC 9.10 * Fix build with GHC 9.10 --- .devcontainer/compose.yaml | 21 ---- .devcontainer/devcontainer.json | 14 --- .github/dependabot.yaml | 12 -- .github/dependabot.yml | 6 + .github/workflows/ci.yml | 105 ++++++++++++++++ .github/workflows/workflow.yaml | 196 ----------------------------- .hlint.yaml | 34 ++--- CHANGELOG.markdown => CHANGELOG.md | 0 LICENSE.markdown => LICENSE.txt | 0 README.markdown | 7 -- README.md | 6 + cabal.project | 15 +-- ratel-wai.cabal | 29 ++--- 13 files changed, 147 insertions(+), 298 deletions(-) delete mode 100644 .devcontainer/compose.yaml delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .github/dependabot.yaml create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/workflow.yaml rename CHANGELOG.markdown => CHANGELOG.md (100%) rename LICENSE.markdown => LICENSE.txt (100%) delete mode 100644 README.markdown create mode 100644 README.md diff --git a/.devcontainer/compose.yaml b/.devcontainer/compose.yaml deleted file mode 100644 index 29382f4..0000000 --- a/.devcontainer/compose.yaml +++ /dev/null @@ -1,21 +0,0 @@ -{ - "services": { - "devcontainer": { - "command": "sh -exc 'sleep infinity'", - "image": "public.ecr.aws/acilearning/haskell:9.6.2", - "init": true, - "volumes": [ - "..:/workspace", - "cabal-cache:/home/vscode/.cache/cabal", - "cabal-state:/home/vscode/.local/state/cabal" - ], - "working_dir": "/workspace" - } - }, - "volumes": { - "cabal-cache": null, - "cabal-state": { - "external": true - } - } -} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index b200a0e..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "customizations": { - "vscode": { - "extensions": [ - "taylorfausak.purple-yolk" - ] - } - }, - "dockerComposeFile": "compose.yaml", - "initializeCommand": "docker volume create cabal-state", - "postCreateCommand": "cabal update", - "service": "devcontainer", - "workspaceFolder": "/workspace" -} diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml deleted file mode 100644 index 0fec246..0000000 --- a/.github/dependabot.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{ - "updates": [ - { - "directory": "/", - "package-ecosystem": "github-actions", - "schedule": { - "interval": "weekly" - } - } - ], - "version": 2 -} diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..49461d8 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +updates: + - directory: / + package-ecosystem: github-actions + schedule: + interval: weekly +version: 2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1e51e6e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,105 @@ +jobs: + build: + name: GHC ${{ matrix.ghc }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - run: mkdir artifact + - id: haskell + uses: haskell-actions/setup@v2 + with: + ghc-version: ${{ matrix.ghc }} + - run: ghc-pkg list + - run: cabal sdist --output-dir artifact + - run: cabal configure --flags=pedantic --jobs + - run: cat cabal.project.local + - run: cp cabal.project.local artifact + - run: cabal freeze + - run: cat cabal.project.freeze + - run: cp cabal.project.freeze artifact + - run: cabal outdated --v2-freeze-file + - uses: actions/cache@v4 + with: + key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} + path: ${{ steps.haskell.outputs.cabal-store }} + restore-keys: ${{ matrix.os }}-${{ matrix.ghc }}- + - run: cabal build --only-download + - run: cabal build --only-dependencies + - run: cabal build + - run: tar --create --file artifact.tar --verbose artifact + - uses: actions/upload-artifact@v4 + with: + name: ratel-wai-${{ github.sha }}-${{ matrix.os }}-${{ matrix.ghc }} + path: artifact.tar + strategy: + matrix: + include: + - ghc: '9.10' + os: macos-13 + - ghc: '9.10' + os: macos-14 + - ghc: 9.6 + os: ubuntu-22.04 + - ghc: 9.8 + os: ubuntu-22.04 + - ghc: '9.10' + os: ubuntu-22.04 + - ghc: '9.10' + os: windows-2022 + cabal: + name: Cabal + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: cabal check + gild: + name: Gild + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: tfausak/cabal-gild-setup-action@v2 + - run: cabal-gild --input ratel-wai.cabal --mode check + hlint: + name: HLint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: haskell-actions/hlint-setup@9e09cc3653fc13702000a35f638a27b064adfbbe + - uses: haskell-actions/hlint-run@v2 + with: + fail-on: status + ormolu: + name: Ormolu + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: haskell-actions/run-ormolu@v15 + release: + if: ${{ github.event_name == 'release' }} + name: Release + needs: build + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + name: ratel-wai-${{ github.sha }}-ubuntu-22.04-9.10 + - run: tar --extract --file artifact.tar --verbose + - uses: softprops/action-gh-release@v2 + with: + files: artifact/ratel-wai-${{ github.event.release.tag_name }}.tar.gz + - run: cabal upload --publish --username '${{ secrets.HACKAGE_USERNAME }}' --password '${{ secrets.HACKAGE_PASSWORD }}' artifact/ratel-wai-${{ github.event.release.tag_name }}.tar.gz +name: CI +on: + pull_request: + branches: + - main + push: + branches: + - main + release: + types: + - created + schedule: + - cron: 0 0 * * 1 diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml deleted file mode 100644 index ab9d660..0000000 --- a/.github/workflows/workflow.yaml +++ /dev/null @@ -1,196 +0,0 @@ -{ - "jobs": { - "build": { - "name": "Build on ${{ matrix.platform }} with GHC ${{ matrix.ghc }}", - "runs-on": "${{ matrix.platform }}-${{ matrix.version }}", - "steps": [ - { - "uses": "actions/checkout@v4" - }, - { - "run": "mkdir artifact" - }, - { - "id": "artifact", - "run": "echo 'directory=artifact/${{ matrix.platform }}-${{ matrix.ghc }}' >> $GITHUB_OUTPUT", - "shell": "bash" - }, - { - "run": "mkdir ${{ steps.artifact.outputs.directory }}" - }, - { - "id": "haskell", - "uses": "haskell-actions/setup@v2", - "with": { - "cabal-version": "3.10.2.1", - "ghc-version": "${{ matrix.ghc }}" - } - }, - { - "run": "cabal sdist --output-dir ${{ steps.artifact.outputs.directory }}" - }, - { - "run": "cabal configure --enable-optimization=2 --flags pedantic --jobs" - }, - { - "run": "cat cabal.project.local" - }, - { - "run": "cp cabal.project.local ${{ steps.artifact.outputs.directory }}" - }, - { - "run": "cabal freeze" - }, - { - "run": "cat cabal.project.freeze" - }, - { - "run": "cp cabal.project.freeze ${{ steps.artifact.outputs.directory }}" - }, - { - "run": "cabal outdated --v2-freeze-file cabal.project.freeze" - }, - { - "uses": "actions/cache@v3", - "with": { - "key": "${{ matrix.platform }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}", - "path": "${{ steps.haskell.outputs.cabal-store }}", - "restore-keys": "${{ matrix.platform }}-${{ matrix.ghc }}-" - } - }, - { - "run": "cabal build --only-download" - }, - { - "run": "cabal build --only-dependencies" - }, - { - "run": "cabal build" - }, - { - "uses": "actions/upload-artifact@v3", - "with": { - "name": "ratel-wai-${{ github.sha }}", - "path": "artifact" - } - } - ], - "strategy": { - "matrix": { - "include": [ - { - "ghc": "9.8.1", - "platform": "macos", - "version": "12" - }, - { - "ghc": "9.4.8", - "platform": "ubuntu", - "version": "22.04" - }, - { - "ghc": "9.6.4", - "platform": "ubuntu", - "version": "22.04" - }, - { - "ghc": "9.8.1", - "platform": "ubuntu", - "version": "22.04" - }, - { - "extension": ".exe", - "ghc": "9.8.1", - "platform": "windows", - "version": "2022" - } - ] - } - } - }, - "cabal": { - "name": "Cabal", - "runs-on": "ubuntu-22.04", - "steps": [ - { - "uses": "actions/checkout@v4" - }, - { - "run": "cabal check" - } - ] - }, - "hlint": { - "name": "HLint", - "runs-on": "ubuntu-22.04", - "steps": [ - { - "uses": "actions/checkout@v4" - }, - { - "uses": "haskell-actions/hlint-setup@v2", - "with": { - "version": 3.5 - } - }, - { - "uses": "haskell-actions/hlint-run@v2", - "with": { - "fail-on": "status" - } - } - ] - }, - "ormolu": { - "name": "Ormolu", - "runs-on": "ubuntu-22.04", - "steps": [ - { - "uses": "actions/checkout@v4" - }, - { - "uses": "haskell-actions/run-ormolu@v15" - } - ] - }, - "release": { - "if": "github.event_name == 'release'", - "name": "Release", - "needs": "build", - "runs-on": "ubuntu-22.04", - "steps": [ - { - "uses": "actions/download-artifact@v3", - "with": { - "name": "ratel-wai-${{ github.sha }}", - "path": "artifact" - } - }, - { - "uses": "svenstaro/upload-release-action@v2", - "with": { - "asset_name": "ratel-wai-${{ github.event.release.tag_name }}.tar.gz", - "file": "artifact/ubuntu-9.8.1/ratel-wai-${{ github.event.release.tag_name }}.tar.gz" - } - }, - { - "run": "cabal upload --publish --username '${{ secrets.HACKAGE_USERNAME }}' --password '${{ secrets.HACKAGE_PASSWORD }}' artifact/ubuntu-9.8.1/ratel-wai-${{ github.event.release.tag_name }}.tar.gz" - } - ] - } - }, - "name": "Workflow", - "on": { - "push": null, - "release": { - "types": [ - "created" - ] - }, - "schedule": [ - { - "cron": "0 0 * * 1" - } - ] - } -} diff --git a/.hlint.yaml b/.hlint.yaml index b4af990..86b48cf 100644 --- a/.hlint.yaml +++ b/.hlint.yaml @@ -1,24 +1,10 @@ -[ - { - "group": { - "enabled": true, - "name": "dollar" - } - }, - { - "group": { - "enabled": true, - "name": "generalise" - } - }, - { - "ignore": { - "name": "Use lambda-case" - } - }, - { - "ignore": { - "name": "Use tuple-section" - } - } -] +- group: + enabled: true + name: dollar +- group: + enabled: true + name: generalise +- ignore: + name: Use lambda-case +- ignore: + name: Use tuple-section diff --git a/CHANGELOG.markdown b/CHANGELOG.md similarity index 100% rename from CHANGELOG.markdown rename to CHANGELOG.md diff --git a/LICENSE.markdown b/LICENSE.txt similarity index 100% rename from LICENSE.markdown rename to LICENSE.txt diff --git a/README.markdown b/README.markdown deleted file mode 100644 index 63610b6..0000000 --- a/README.markdown +++ /dev/null @@ -1,7 +0,0 @@ -# ratel-wai - -[![Workflow](https://github.com/tfausak/ratel-wai/actions/workflows/workflow.yaml/badge.svg)](https://github.com/tfausak/ratel-wai/actions/workflows/workflow.yaml) -[![Hackage](https://img.shields.io/hackage/v/ratel-wai)](https://hackage.haskell.org/package/ratel-wai) -[![Stackage](https://www.stackage.org/package/ratel-wai/badge/nightly?label=stackage)](https://www.stackage.org/package/ratel-wai) - -ratel-wai notifies Honeybadger about exceptions via a WAI middleware. diff --git a/README.md b/README.md new file mode 100644 index 0000000..0d2a390 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# ratel-wai + +[![CI](https://github.com/tfausak/ratel-wai/actions/workflows/ci.yml/badge.svg)](https://github.com/tfausak/ratel-wai/actions/workflows/ci.yml) +[![Hackage](https://badgen.net/hackage/v/ratel-wai)](https://hackage.haskell.org/package/ratel-wai) + +ratel-wai notifies Honeybadger about exceptions via a WAI middleware. diff --git a/cabal.project b/cabal.project index 764d584..b305fed 100644 --- a/cabal.project +++ b/cabal.project @@ -1,13 +1,8 @@ packages: . - allow-newer: - , cryptohash-md5:base - - -- https://github.com/haskell-hvr/cryptohash-sha1/issues/18 - , cryptohash-sha1:base - - -- https://github.com/haskell/entropy/pull/79 - , entropy:Cabal - - -- https://github.com/tfausak/ratel/pull/11 + -- https://github.com/tfausak/ratel/pull/23 , ratel:base + -- https://github.com/haskell-hvr/uuid/issues/82 + , uuid-types:template-haskell + -- https://github.com/HeinrichApfelmus/vault/pull/41 + , vault:base diff --git a/ratel-wai.cabal b/ratel-wai.cabal index 171fb4c..4e3722e 100644 --- a/ratel-wai.cabal +++ b/ratel-wai.cabal @@ -1,16 +1,17 @@ cabal-version: 2.2 - name: ratel-wai version: 2.0.0.6 - synopsis: Notify Honeybadger about exceptions via a WAI middleware. description: ratel-wai notifies Honeybadger about exceptions via a WAI middleware. build-type: Simple category: Exceptions -extra-source-files: CHANGELOG.markdown README.markdown -license-file: LICENSE.markdown +extra-doc-files: + CHANGELOG.md + README.md + +license-file: LICENSE.txt license: MIT maintainer: Taylor Fausak @@ -20,18 +21,10 @@ source-repository head flag pedantic default: False - description: Enables @-Werror@, which turns warnings into errors. manual: True common library - build-depends: - , base >= 4.16.0 && < 4.20 - , bytestring >= 0.11.3 && < 0.13 - , case-insensitive >= 1.2.1 && < 1.3 - , containers >= 0.6.5 && < 0.7 - , http-client >= 0.7.13 && < 0.8 - , ratel >= 1.0.12 && < 1.1 || >= 2.0.0 && < 2.1 - , wai >= 3.2.3 && < 3.3 + build-depends: base ^>=4.18.0.0 || ^>=4.19.0.0 || ^>=4.20.0.0 default-language: Haskell2010 ghc-options: -Weverything @@ -48,6 +41,14 @@ common library library import: library - + build-depends: + bytestring ^>=0.11.4.0 || ^>=0.12.0.2, + case-insensitive ^>=1.2.1.0, + containers ^>=0.6.7 || ^>=0.7, + http-client ^>=0.7.17, + ratel ^>=2.0.0.11, + wai ^>=3.2.4, + + -- cabal-gild: discover source/library exposed-modules: Ratel.Wai hs-source-dirs: source/library