From 5aa66fd43605059b007c569dbbf4e9b4839027c3 Mon Sep 17 00:00:00 2001 From: Taylor Fausak Date: Sat, 18 May 2024 11:14:34 -0500 Subject: [PATCH] Revert "Revert "Upgrade to GHC 9.10"" (#36) This reverts commit 7e4453b052dca80e0207e465a7c28a7b2e0721dc. --- .devcontainer/compose.yaml | 21 --- .devcontainer/devcontainer.json | 14 -- .github/{dependabot.yaml => dependabot.yml} | 0 .github/workflows/ci.yml | 106 +++++++++++ .github/workflows/workflow.yaml | 199 -------------------- CHANGELOG.markdown => CHANGELOG.md | 0 LICENSE.markdown => LICENSE.txt | 0 README.markdown => README.md | 5 +- flow.cabal | 20 +- 9 files changed, 116 insertions(+), 249 deletions(-) delete mode 100644 .devcontainer/compose.yaml delete mode 100644 .devcontainer/devcontainer.json rename .github/{dependabot.yaml => dependabot.yml} (100%) 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%) rename README.markdown => README.md (84%) 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.yml similarity index 100% rename from .github/dependabot.yaml rename to .github/dependabot.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3105f32 --- /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: flow-${{ github.sha }}-${{ matrix.os }}-${{ matrix.ghc }} + path: artifact.tar + - run: cabal run -- flow-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 flow.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: flow-${{ github.sha }}-ubuntu-22.04-9.10 + - run: tar --extract --file artifact.tar --verbose + - uses: softprops/action-gh-release@v2 + with: + files: artifact/flow-${{ github.event.release.tag_name }}.tar.gz + - run: cabal upload --publish --username '${{ secrets.HACKAGE_USERNAME }}' --password '${{ secrets.HACKAGE_PASSWORD }}' artifact/flow-${{ 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 cdd7906..0000000 --- a/.github/workflows/workflow.yaml +++ /dev/null @@ -1,199 +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": "flow-${{ github.sha }}", - "path": "artifact" - } - }, - { - "run": "cabal run flow-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", - "runs-on": "ubuntu-22.04", - "steps": [ - { - "uses": "actions/download-artifact@v3", - "with": { - "name": "flow-${{ github.sha }}", - "path": "artifact" - } - }, - { - "uses": "svenstaro/upload-release-action@v2", - "with": { - "asset_name": "flow-${{ github.event.release.tag_name }}.tar.gz", - "file": "artifact/ubuntu-9.8.1/flow-${{ github.event.release.tag_name }}.tar.gz" - } - }, - { - "run": "cabal upload --publish --username '${{ secrets.HACKAGE_USERNAME }}' --password '${{ secrets.HACKAGE_PASSWORD }}' artifact/ubuntu-9.8.1/flow-${{ 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.md similarity index 84% rename from README.markdown rename to README.md index 7599315..878f1c1 100644 --- a/README.markdown +++ b/README.md @@ -1,8 +1,7 @@ # [Flow][] -[![Workflow](https://github.com/tfausak/flow/actions/workflows/workflow.yaml/badge.svg)](https://github.com/tfausak/flow/actions/workflows/workflow.yaml) -[![Hackage](https://img.shields.io/hackage/v/flow)](https://hackage.haskell.org/package/flow) -[![Stackage](https://www.stackage.org/package/flow/badge/nightly?label=stackage)](https://www.stackage.org/package/flow) +[![CI](https://github.com/tfausak/flow/actions/workflows/ci.yml/badge.svg)](https://github.com/tfausak/flow/actions/workflows/ci.yml) +[![Hackage](https://badgen.net/hackage/v/flow)](https://hackage.haskell.org/package/flow) Write more understandable Haskell. diff --git a/flow.cabal b/flow.cabal index e85800b..551480e 100644 --- a/flow.cabal +++ b/flow.cabal @@ -1,15 +1,15 @@ cabal-version: 2.2 - name: flow version: 2.0.0.4 - synopsis: Write more understandable Haskell. description: Flow provides operators for writing more understandable Haskell. - build-type: Simple category: Combinators, Functions, Utility -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 @@ -23,8 +23,7 @@ flag pedantic manual: True common library - build-depends: - , base >= 4.16.0 && < 4.20 + build-depends: base ^>=4.18.0.0 || ^>=4.19.0.0 || ^>=4.20.0.0 default-language: Haskell2010 ghc-options: -Weverything @@ -40,24 +39,21 @@ common library common executable import: library - build-depends: flow ghc-options: -rtsopts -threaded - -Wno-unused-packages library import: library - exposed-modules: Flow hs-source-dirs: source/library test-suite flow-test-suite import: executable - build-depends: - , HUnit >= 1.6.1 && < 1.7 + HUnit ^>=1.6.2.0 + hs-source-dirs: source/test-suite main-is: Main.hs type: exitcode-stdio-1.0