Skip to content

Commit

Permalink
Stack CI for GHC 8.4-9.10
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasabel committed Jan 7, 2025
1 parent 3ebdc69 commit ded1697
Show file tree
Hide file tree
Showing 14 changed files with 115 additions and 2 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/stack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Stack
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
check:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
ghc-ver: ['9.10', '9.8', '9.6', '9.4', '9.2', '9.0', '8.10', '8.8', '8.6', '8.4']
include:
- os: macos-latest
ghc-ver: '9.10'
- os: windows-latest
ghc-ver: '9.10'

env:
ARGS: "--stack-yaml=stack-${{ matrix.ghc-ver }}.yaml --no-terminal --system-ghc"
# --no-install-ghc also prevents the installation of MSYS2 on Windows
# https://github.com/commercialhaskell/stack/issues/6675

# Needed for Windows to make piping (... >> ...) and evaluation ( $(...) ) work.
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4

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

- name: Install the brotli library (Windows)
if: runner.os == 'Windows'
# Andreas Abel, 2022-02-15 / 2025-01-07:
# Stack might be packing an old version of MSYS2.
# To work around certification problems, we update msys2-keyring.
run: |
stack exec ${{ env.ARGS }} -- pacman --noconfirm -Sy msys2-keyring
stack exec ${{ env.ARGS }} -- pacman --noconfirm -S mingw-w64-x86_64-pkgconf
stack exec ${{ env.ARGS }} -- pacman --noconfirm -S mingw-w64-x86_64-brotli
- name: Install the brotli library (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install libbrotli-dev -qq
- name: Cache dependencies (restore)
uses: actions/cache/restore@v4
id: cache
with:
path: ${{ steps.setup.outputs.stack-root }}
# Use a unique primary key (always save new cache); works if caches aren't to big or too many...
key: ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }}-commit-${{ github.sha }}
restore-keys: ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }}-

- name: Install dependencies
run: |
stack build ${{ env.ARGS }} --test --only-dependencies
- name: Build hackage-cli
run: |
stack build ${{ env.ARGS }}
- name: Test hackage-cli
run: |
stack test ${{ env.ARGS }}
- name: Cache dependencies (save)
uses: actions/cache/save@v4
if: always() && steps.cache.outputs.cache-hit != 'true'
# # Will fail if we already have a cache with this key (in this case, cache-hit is true).
with:
path: ${{ steps.setup.outputs.stack-root }}
key: ${{ steps.cache.outputs.cache-primary-key }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/dist-newstyle/
/.ghc.environment.*
*~
/.stack-work/
/stack*.yaml.lock
6 changes: 4 additions & 2 deletions brotli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ test-suite brotli-tests
, bytestring
-- additional dependencies that require version bounds
build-depends: HUnit == 1.6.*
, QuickCheck >= 2.14 && < 2.16
, tasty >= 1.2 && < 1.6
, QuickCheck >= 2.11.3 && < 2.16
-- LTS 12.26 has QuickCheck-2.11.3
, tasty >= 1.1.0.4 && < 1.6
-- LTS 12.26 has tasty-1.1.0.4
, tasty-hunit == 0.10.*
, tasty-quickcheck >= 0.10 && < 1

Expand Down
1 change: 1 addition & 0 deletions stack-8.10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolver: lts-18.28
1 change: 1 addition & 0 deletions stack-8.4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolver: lts-12.26
1 change: 1 addition & 0 deletions stack-8.6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolver: lts-14.27
1 change: 1 addition & 0 deletions stack-8.8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolver: lts-16.31
1 change: 1 addition & 0 deletions stack-9.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolver: lts-19.33
1 change: 1 addition & 0 deletions stack-9.10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolver: nightly-2025-01-05
9 changes: 9 additions & 0 deletions stack-9.2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resolver: lts-20.26

extra-deps:
- attoparsec-aeson-2.1.0.0
- snap-1.1.3.3
- snap-core-1.0.5.1
- snap-server-1.1.2.1
- heist-1.1.1.2
- readable-0.3.1
5 changes: 5 additions & 0 deletions stack-9.4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resolver: lts-21.25

extra-deps:
- snap-1.1.3.3
- snap-server-1.1.2.1
1 change: 1 addition & 0 deletions stack-9.6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolver: lts-22.43
1 change: 1 addition & 0 deletions stack-9.8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolver: lts-23.3
1 change: 1 addition & 0 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resolver: nightly-2024-01-23

0 comments on commit ded1697

Please sign in to comment.