From 40f3b4b7a6029de318867b9da29dc5b400f4697e Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Sun, 19 May 2024 10:50:13 -0500 Subject: [PATCH] Add support for GHC 9.10, remove support for GHC 9.4 (#13) * Upgrade to GHC 9.10 * Update badges --- .devcontainer/compose.yaml | 21 --- .devcontainer/devcontainer.json | 14 -- .github/dependabot.yaml | 12 -- .github/dependabot.yml | 6 + .github/workflows/ci.yml | 106 +++++++++++++++ .github/workflows/workflow.yaml | 202 ----------------------------- CHANGELOG.markdown => CHANGELOG.md | 0 LICENSE.markdown => LICENSE.txt | 0 README.markdown | 9 -- README.md | 8 ++ saturn.cabal | 102 ++++++++------- 11 files changed, 177 insertions(+), 303 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..61317bf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,106 @@ +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 --enable-tests --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: saturn-${{ github.sha }}-${{ matrix.os }}-${{ matrix.ghc }} + path: artifact.tar + - run: cabal run -- saturn-test-suite --randomize --strict + 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 saturn.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: saturn-${{ github.sha }}-ubuntu-22.04-9.10 + - run: tar --extract --file artifact.tar --verbose + - uses: softprops/action-gh-release@v2 + with: + files: artifact/saturn-${{ github.event.release.tag_name }}.tar.gz + - run: cabal upload --publish --username '${{ secrets.HACKAGE_USERNAME }}' --password '${{ secrets.HACKAGE_PASSWORD }}' artifact/saturn-${{ 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 dfa7d74..0000000 --- a/.github/workflows/workflow.yaml +++ /dev/null @@ -1,202 +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": "saturn-${{ github.sha }}", - "path": "artifact" - } - }, - { - "run": "cabal run saturn-test-suite" - } - ], - "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", - "permissions": { - "contents": "write" - }, - "runs-on": "ubuntu-22.04", - "steps": [ - { - "uses": "actions/download-artifact@v3", - "with": { - "name": "saturn-${{ github.sha }}", - "path": "artifact" - } - }, - { - "uses": "svenstaro/upload-release-action@v2", - "with": { - "asset_name": "saturn-${{ github.event.release.tag_name }}.tar.gz", - "file": "artifact/ubuntu-9.8.1/saturn-${{ github.event.release.tag_name }}.tar.gz" - } - }, - { - "run": "cabal upload --publish --username '${{ secrets.HACKAGE_USERNAME }}' --password '${{ secrets.HACKAGE_PASSWORD }}' artifact/ubuntu-9.8.1/saturn-${{ github.event.release.tag_name }}.tar.gz" - } - ] - } - }, - "name": "Workflow", - "on": { - "push": null, - "release": { - "types": [ - "created" - ] - }, - "schedule": [ - { - "cron": "0 0 * * 1" - } - ] - } -} 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 53b1818..0000000 --- a/README.markdown +++ /dev/null @@ -1,9 +0,0 @@ -# Saturn - -[![Workflow](https://github.com/tfausak/saturn/actions/workflows/workflow.yaml/badge.svg)](https://github.com/tfausak/saturn/actions/workflows/workflow.yaml) -[![Hackage](https://img.shields.io/hackage/v/saturn)](https://hackage.haskell.org/package/saturn) -[![Stackage](https://www.stackage.org/package/saturn/badge/nightly?label=stackage)](https://www.stackage.org/package/saturn) - -:ringed_planet: Handle POSIX cron schedules. - -See the documentation on Hackage: . diff --git a/README.md b/README.md new file mode 100644 index 0000000..1598a24 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# Saturn + +[![CI](https://github.com/tfausak/saturn/actions/workflows/ci.yml/badge.svg)](https://github.com/tfausak/saturn/actions/workflows/ci.yml) +[![Hackage](https://badgen.net/hackage/v/saturn)](https://hackage.haskell.org/package/saturn) + +:ringed_planet: Handle POSIX cron schedules. + +See the documentation on Hackage: . diff --git a/saturn.cabal b/saturn.cabal index 98e58cb..53daf60 100644 --- a/saturn.cabal +++ b/saturn.cabal @@ -1,47 +1,54 @@ -cabal-version: 3.0 -name: saturn -version: 1.0.0.4 -synopsis: Handle POSIX cron schedules. -description: Saturn handles POSIX cron schedules. -build-type: Simple -category: Cron +cabal-version: 3.0 +name: saturn +version: 1.0.0.4 +synopsis: Handle POSIX cron schedules. +description: Saturn handles POSIX cron schedules. +build-type: Simple +category: Cron extra-doc-files: - CHANGELOG.markdown - README.markdown + CHANGELOG.md + README.md -maintainer: Taylor Fausak -license: MIT -license-file: LICENSE.markdown +maintainer: Taylor Fausak +license: MIT +license-file: LICENSE.txt source-repository head location: https://github.com/tfausak/saturn - type: git + type: git flag pedantic default: False - manual: True + manual: True common library - build-depends: base ^>=4.16.0 || ^>=4.17.0 || ^>=4.18.0 || ^>=4.19.0 + build-depends: base ^>=4.18.0.0 || ^>=4.19.0.0 || ^>=4.20.0.0 default-language: Haskell2010 ghc-options: - -Weverything -Wno-all-missed-specialisations -Wno-implicit-prelude - -Wno-missed-specialisations -Wno-missing-deriving-strategies - -Wno-missing-export-lists -Wno-missing-kind-signatures - -Wno-missing-safe-haskell-mode -Wno-prepositive-qualified-module - -Wno-safe -Wno-unsafe + -Weverything + -Wno-all-missed-specialisations + -Wno-implicit-prelude + -Wno-missed-specialisations + -Wno-missing-deriving-strategies + -Wno-missing-export-lists + -Wno-missing-kind-signatures + -Wno-missing-safe-haskell-mode + -Wno-prepositive-qualified-module + -Wno-safe + -Wno-unsafe if flag(pedantic) ghc-options: -Werror library unstable - import: library + import: library build-depends: - , containers ^>=0.6.5 - , parsec ^>=3.1.14 - , text ^>=1.2.5 || ^>=2.0.2 || ^>=2.1 - , time ^>=1.11.1 || ^>=1.12.2 + containers ^>=0.6.7 || ^>=0.7, + parsec ^>=3.1.16.1, + text ^>=2.0.2 || ^>=2.1, + time ^>=1.12.2 || ^>=1.14, + -- cabal-gild: discover source/libraries/unstable exposed-modules: Saturn.Unstable.Constant Saturn.Unstable.Extra.Int @@ -64,25 +71,27 @@ library unstable Saturn.Unstable.Type.Weekday Saturn.Unstable.Type.Wildcard - hs-source-dirs: source/libraries/unstable - visibility: public + hs-source-dirs: source/libraries/unstable + visibility: public library - import: library - build-depends: saturn:unstable + import: library + build-depends: saturn:unstable + -- cabal-gild: discover source/libraries/saturn exposed-modules: Saturn - hs-source-dirs: source/libraries/saturn + hs-source-dirs: source/libraries/saturn library spec - import: library + import: library build-depends: - , hspec ^>=2.9.0 || ^>=2.10.0 || ^>=2.11.0 - , parsec - , QuickCheck ^>=2.14.3 || ^>=2.15 - , saturn:unstable - , text - , time + QuickCheck ^>=2.14.3 || ^>=2.15, + hspec ^>=2.11.8, + parsec, + saturn:unstable, + text, + time, + -- cabal-gild: discover source/libraries/spec exposed-modules: Saturn.Unstable.ConstantSpec Saturn.Unstable.Extra.IntSpec @@ -106,16 +115,19 @@ library spec Saturn.Unstable.Type.WildcardSpec SaturnSpec - hs-source-dirs: source/libraries/spec - visibility: public + hs-source-dirs: source/libraries/spec + visibility: public test-suite saturn-test-suite - import: library + import: library build-depends: - , hspec - , saturn:spec + hspec, + saturn:spec, + + ghc-options: + -rtsopts + -threaded - ghc-options: -rtsopts -threaded hs-source-dirs: source/test-suite - main-is: Main.hs - type: exitcode-stdio-1.0 + main-is: Main.hs + type: exitcode-stdio-1.0