Skip to content

Commit

Permalink
Add support for GHC 9.10, remove support for GHC 9.4 (#27)
Browse files Browse the repository at this point in the history
* Upgrade to GHC 9.10

* Fix copy-paste error

* Fix another copy-paste error
  • Loading branch information
tfausak authored May 18, 2024
1 parent 8ca84e9 commit b5e7f94
Show file tree
Hide file tree
Showing 10 changed files with 143 additions and 319 deletions.
21 changes: 0 additions & 21 deletions .devcontainer/compose.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions .devcontainer/devcontainer.json

This file was deleted.

12 changes: 0 additions & 12 deletions .github/dependabot.yaml

This file was deleted.

6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
updates:
- directory: /
package-ecosystem: github-actions
schedule:
interval: weekly
version: 2
339 changes: 113 additions & 226 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,226 +1,113 @@
{
"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"
},
{
"run": "cp \"$( cabal list-bin autoexporter )\" ${{ steps.artifact.outputs.directory }}"
},
{
"uses": "svenstaro/upx-action@v2",
"with": {
"files": "${{ steps.artifact.outputs.directory }}/autoexporter${{ matrix.extension }}"
}
},
{
"uses": "actions/upload-artifact@v3",
"with": {
"name": "autoexporter-${{ 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": "autoexporter-${{ github.sha }}",
"path": "artifact"
}
},
{
"uses": "svenstaro/upload-release-action@v2",
"with": {
"asset_name": "autoexporter-${{ github.event.release.tag_name }}-ubuntu",
"file": "artifact/ubuntu-9.8.1/autoexporter"
}
},
{
"uses": "svenstaro/upload-release-action@v2",
"with": {
"asset_name": "autoexporter-${{ github.event.release.tag_name }}-macos",
"file": "artifact/macos-9.8.1/autoexporter"
}
},
{
"uses": "svenstaro/upload-release-action@v2",
"with": {
"asset_name": "autoexporter-${{ github.event.release.tag_name }}-windows.exe",
"file": "artifact/windows-9.8.1/autoexporter.exe"
}
},
{
"uses": "svenstaro/upload-release-action@v2",
"with": {
"asset_name": "autoexporter-${{ github.event.release.tag_name }}.tar.gz",
"file": "artifact/ubuntu-9.8.1/autoexporter-${{ github.event.release.tag_name }}.tar.gz"
}
},
{
"run": "cabal upload --publish --username '${{ secrets.HACKAGE_USERNAME }}' --password '${{ secrets.HACKAGE_PASSWORD }}' artifact/ubuntu-9.8.1/autoexporter-${{ github.event.release.tag_name }}.tar.gz"
}
]
}
},
"name": "Workflow",
"on": {
"push": null,
"release": {
"types": [
"created"
]
},
"schedule": [
{
"cron": "0 0 * * 1"
}
]
}
}
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-optimization=2 --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: cp $( cabal list-bin autoexporter ) artifact
- run: tar --create --file artifact.tar --verbose artifact
- uses: actions/upload-artifact@v4
with:
name: autoexporter-${{ github.sha }}-ghc-${{ matrix.ghc }}-${{ matrix.os }}
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
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
gild:
name: Gild
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tfausak/cabal-gild-setup-action@v2
- run: cabal-gild --input autoexporter.cabal --mode check
ormolu:
name: Ormolu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/run-ormolu@v15
release:
env:
PREFIX: autoexporter-${{ github.event.release.tag_name }}
if: ${{ github.event_name == 'release' }}
name: Release
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- run: sh -exc 'for d in *; do cd $d; tar --extract --file artifact.tar --verbose; cd ..; done'
- run: cp autoexporter-${{ github.sha }}-ghc-9.10-ubuntu-22.04/artifact/${{ env.PREFIX }}.tar.gz .
- run: tar --auto-compress --create --file ../../${{ env.PREFIX }}-darwin-x64.tar.gz --verbose autoexporter
working-directory: autoexporter-${{ github.sha }}-ghc-9.10-macos-13/artifact
- run: tar --auto-compress --create --file ../../${{ env.PREFIX }}-darwin-arm64.tar.gz --verbose autoexporter
working-directory: autoexporter-${{ github.sha }}-ghc-9.10-macos-14/artifact
- run: tar --auto-compress --create --file ../../${{ env.PREFIX }}-linux-x64.tar.gz --verbose autoexporter
working-directory: autoexporter-${{ github.sha }}-ghc-9.10-ubuntu-22.04/artifact
- run: tar --auto-compress --create --file ../../${{ env.PREFIX }}-win32-x64.tar.gz --verbose autoexporter.exe
working-directory: autoexporter-${{ github.sha }}-ghc-9.10-windows-2022/artifact
- uses: softprops/action-gh-release@v2
with:
files: ${{ env.PREFIX }}*.tar.gz
- run: cabal upload --publish --username '${{ secrets.HACKAGE_USERNAME }}' --password '${{ secrets.HACKAGE_PASSWORD }}' ${{ env.PREFIX }}.tar.gz
name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
release:
types:
- created
schedule:
- cron: 0 0 * * 1
Loading

0 comments on commit b5e7f94

Please sign in to comment.