mirror of
https://github.com/xmonad/xmonad.git
synced 2025-05-19 00:20:22 -07:00
Debian stable is not on 8.6, which was always our guide as to which GHC
versions we want to support.
In particular, this lets us get rid of all the quickcheck-classes
special treatment.
Related: 400730fe3b
82 lines
2.5 KiB
YAML
82 lines
2.5 KiB
YAML
name: Stack
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
build:
|
|
name: Stack CI - Linux - ${{ matrix.resolver }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- resolver: lts-14 # GHC 8.6
|
|
- resolver: lts-16 # GHC 8.8
|
|
- resolver: lts-18 # GHC 8.10
|
|
- resolver: lts-19 # GHC 9.0
|
|
- resolver: lts-20 # GHC 9.2
|
|
|
|
steps:
|
|
- name: Clone project
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Prepare apt sources
|
|
run: |
|
|
set -ex
|
|
sudo add-apt-repository -y ppa:hvr/ghc
|
|
sudo apt update -y
|
|
|
|
- name: Install C dependencies
|
|
run: |
|
|
set -ex
|
|
sudo apt install -y \
|
|
libx11-dev \
|
|
libxext-dev \
|
|
libxinerama-dev \
|
|
libxrandr-dev \
|
|
libxss-dev \
|
|
#
|
|
|
|
- name: Refresh caches once a month
|
|
id: cache-date
|
|
# GHA writes caches on the first miss and then never updates them again;
|
|
# force updating the cache at least once a month. Additionally, the
|
|
# date is prefixed with an epoch number to let us manually refresh the
|
|
# cache when needed. This is a workaround for https://github.com/actions/cache/issues/2
|
|
run: |
|
|
date +date=1-%Y-%m >> $GITHUB_OUTPUT
|
|
|
|
- name: Cache Haskell package metadata
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/.stack/pantry
|
|
key: stack-pantry-${{ runner.os }}-${{ steps.cache-date.outputs.date }}
|
|
|
|
- name: Cache Haskell dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.stack/*
|
|
!~/.stack/pantry
|
|
!~/.stack/programs
|
|
key: stack-${{ runner.os }}-${{ matrix.resolver }}-${{ steps.cache-date.outputs.date }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('*.cabal') }}
|
|
restore-keys: |
|
|
stack-${{ runner.os }}-${{ matrix.resolver }}-${{ steps.cache-date.outputs.date }}-${{ hashFiles('stack.yaml') }}-
|
|
stack-${{ runner.os }}-${{ matrix.resolver }}-${{ steps.cache-date.outputs.date }}-
|
|
|
|
- name: Update hackage index
|
|
# always update index to prevent the shared ~/.stack/pantry cache from being empty
|
|
run: |
|
|
set -ex
|
|
stack update
|
|
|
|
- name: Build and test
|
|
run: |
|
|
set -ex
|
|
stack test \
|
|
--fast --no-terminal \
|
|
--resolver=${{ matrix.resolver }} --system-ghc \
|
|
--flag=xmonad:pedantic
|