Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump CI to GHC 9.8 and latest versions of actions #573

Merged
merged 3 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 26 additions & 28 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ on:
pull_request:
branches: [ 'master' ]

env:
autoconf_ver: 2.69
# env:
# autoconf_ver: 2.69

jobs:
autoconf:
runs-on: ubuntu-latest
container: ubuntu:22.10
# container: ubuntu:22.10
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could remove that line altogether.
If it is important that this CI run in a certain container, that should be justified here in a comment.


steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install autoconf
run: |
apt-get update -y -qq
apt-get install -y -qq build-essential autoconf${{ env.autoconf_ver }}
sudo apt-get update -y -qq
sudo apt-get install -y -qq build-essential autoconf${{ env.autoconf_ver }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sudo is needed for installing on bare Linux runner.

- name: run autoreconf
run: |
autoreconf${{ env.autoconf_ver }} -fi
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: configure
path: |
Expand All @@ -35,26 +35,26 @@ jobs:
needs: autoconf

steps:
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
with:
cabal-version: '3.4'
cabal-version: 'latest'

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: configure

- name: run sdist
run: |
cabal sdist

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist-tarball
path: dist-newstyle/sdist/network-*

- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist-newstyle/sdist/network-*
Expand All @@ -67,50 +67,48 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'macOS-latest', 'windows-latest' ]
ghc: [ '8.10', '9.0', '9.2', '9.4', '9.6' ]
ghc: [ '8.4', '9.4', '9.6', '9.8' ]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should '8.4' be '8.10'?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, the proposal here is to test

  • the latest 3 major GHCs, and
  • the oldest GHC that is supported cross all OSs.

The latter turned out to be GHC 8.4.

# Dependency hsc2hs does not build on Windows with GHC < 8.4
# so we test 8.4 as lowest.
# See https://github.com/haskell/hsc2hs/issues/81

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: haskell/actions/setup@v2
- uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: latest
cabal-update: true

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: configure

- name: Haskell versions
shell: bash
run: |
echo "GHC_VERSION=$(ghc --numeric-version)" >> "${GITHUB_ENV}"
echo "CABAL_VERSION=$(cabal --numeric-version)" >> "${GITHUB_ENV}"

- name: Cabal configure
run: |
cabal configure --enable-tests --disable-benchmarks --disable-documentation

- name: Cache (restore)
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
id: cache
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: build-${{ runner.os }}-ghc-${{ env.GHC_VERSION }}-cabal-${{ env.CABAL_VERSION }}-sha-${{ github.sha }}
key: build-${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}-sha-${{ github.sha }}
# Append commit SHA so that new cache is always written.
# This is fine as long as we do not hit the total cache limit of 10GB.
restore-keys: |
build-${{ runner.os }}-ghc-${{ env.GHC_VERSION }}-cabal-${{ env.CABAL_VERSION }}-
build-${{ runner.os }}-ghc-${{ env.GHC_VERSION }}-
build-${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}-
build-${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-

- name: Install dependencies
run: |
cabal build --only-dependencies

- name: Cache (save)
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: always()
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ cabal.sandbox.config
.cabal-sandbox
.stack-work/
.ghc.*
.vscode
.vscode
/stack.yaml.lock
7 changes: 4 additions & 3 deletions network.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ license-file: LICENSE
maintainer: Kazu Yamamoto, Evan Borden

tested-with:
GHC == 9.6.2
GHC == 9.4.5
GHC == 9.8.2
GHC == 9.6.4
GHC == 9.4.8
GHC == 9.2.8
GHC == 9.0.2
GHC == 8.10.7
Expand Down Expand Up @@ -192,7 +193,7 @@ test-suite spec
default-language: Haskell2010
ghc-options: -Wall -threaded
build-depends:
base >=4.9 && <5,
base,
bytestring,
directory,
HUnit,
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resolver: lts-17.15
resolver: lts-21.25
packages:
- '.'
nix:
Expand Down
Loading