Allow containers-0.7, bump CI to GHC 9.6.3 #105
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build with 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.6.3, 9.4.7, 9.2.8, 9.0.2, 8.10.7] | |
# On ubuntu-22.04 the old versions 8.8.4, 8.6.5, 8.4.4, 8.2.2 fail due to HsOpenSSL linking errors. | |
# They used to work under ubuntu-20.04, but it is not worth the trouble maintaining them. | |
# Apparently, HsOpenSSL-0.11.6 and older are too old for ubuntu-22.04. | |
include: | |
- os: macos-latest | |
ghc-ver: 9.6.3 | |
- os: windows-latest | |
ghc-ver: 9.6.3 | |
env: | |
ARGS: "--stack-yaml=stack-${{ matrix.ghc-ver }}.yaml --no-terminal --system-ghc" | |
# Needed for Windows to make piping (... >> ...) and evaluation ( $(...) ) work. | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: haskell-actions/setup@v2 | |
id: haskell-setup | |
with: | |
ghc-version: ${{ matrix.ghc-ver }} | |
enable-stack: true | |
- name: Install the brotli library (Windows) | |
if: ${{ runner.os == 'Windows' }} | |
# Andreas Abel, 2022-02-15: | |
# Stack is packing an old version of MSYS2. | |
# To work around certification problems, we need to update msys2-keyring. | |
run: | | |
stack exec ${{ env.ARGS }} -- pacman --noconfirm -Sy msys2-keyring | |
stack exec ${{ env.ARGS }} -- pacman --noconfirm -S mingw-w64-x86_64-pkg-config | |
stack exec ${{ env.ARGS }} -- pacman --noconfirm -S mingw-w64-x86_64-brotli | |
stack exec ${{ env.ARGS }} -- pacman --noconfirm -S mingw-w64-x86_64-openssl | |
- name: Install the brotli library (Ubuntu) | |
if: ${{ runner.os == 'Linux' }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install libbrotli-dev -qq | |
- name: Set environment variables based on Haskell setup | |
run: | | |
STACK_VER=$(stack --numeric-version) | |
echo "STACK_VER=${STACK_VER}" >> "${GITHUB_ENV}" | |
- name: Cache dependencies (restore) | |
uses: actions/cache/restore@v3 | |
id: cache | |
with: | |
path: ${{ steps.haskell-setup.outputs.stack-root }} | |
key: ${{ runner.os }}-stack-${{ env.STACK_VER }}-ghc-${{ matrix.ghc-ver }}-${{ hashFiles(format('stack-{0}.yaml', matrix.ghc-ver)) }} | |
restore-keys: ${{ runner.os }}-stack-${{ env.STACK_VER }}-ghc-${{ matrix.ghc-ver }}- | |
- name: Install dependencies | |
if: ${{ !steps.cache.outputs.cache-hit }} | |
run: | | |
stack build ${{ env.ARGS }} --test --only-dependencies | |
- name: Cache dependencies (save) | |
uses: actions/cache/save@v3 | |
env: | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
# Will fail if we already have a cache with this key. | |
if: ${{ !(steps.cache.outputs.cache-hit && env.key == steps.cache.outputs.cache-matched-key) }} | |
with: | |
path: ${{ steps.haskell-setup.outputs.stack-root }} | |
key: ${{ env.key }} | |
- name: Build hackage-cli | |
run: | | |
stack build ${{ env.ARGS }} | |
- name: Test hackage-cli | |
run: | | |
stack test ${{ env.ARGS }} |