Files
xmonad-contrib/.github/workflows/stack.yml
Tomas Janousek 96aae28641 ci: Cache pantry (hackage metadata) separately
This further reduces our usage of cache storage by caching the metadata
only once per repo. Now the metadata cache is ~250MB and the individual
caches with built dependencies are ~10M each.

Related: cfe99998fc
Related: https://github.com/xmonad/X11/pull/75
2021-05-24 00:19:33 +01:00

87 lines
2.3 KiB
YAML

name: Stack
on:
push:
pull_request:
jobs:
build:
name: Stack CI - Linux - ${{ matrix.resolver }} - ${{ matrix.yaml }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- resolver: lts-12
ghc: 8.4.4
yaml: stack.yaml
- resolver: lts-12
ghc: 8.4.4
yaml: stack-master.yaml
- resolver: lts-14
ghc: 8.6.5
yaml: stack-master.yaml
- resolver: lts-16
ghc: 8.8.4
yaml: stack-master.yaml
- resolver: lts-17
ghc: 8.10.4
yaml: stack.yaml
- resolver: lts-17
ghc: 8.10.4
yaml: stack-master.yaml
steps:
- name: Clone project
uses: actions/checkout@v2
- 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 \
libxft-dev \
libxinerama-dev \
libxrandr-dev \
libxss-dev \
#
- name: Install GHC
# use system ghc in stack, don't waste GH Actions cache space
run: |
set -ex
sudo apt install -y ghc-${{ matrix.ghc }}
echo /opt/ghc/${{ matrix.ghc }}/bin >> $GITHUB_PATH
- name: Cache Haskell package metadata
uses: actions/cache@v2
with:
path: ~/.stack/pantry
key: stack-pantry-${{ runner.os }}
- name: Cache Haskell dependencies
uses: actions/cache@v2
with:
path: |
~/.stack/*
!~/.stack/pantry
key: stack-${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles(matrix.yaml) }}-${{ hashFiles('*.cabal') }}
restore-keys: |
stack-${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles(matrix.yaml) }}-
stack-${{ runner.os }}-${{ matrix.resolver }}-
- name: Build and test
run: |
set -ex
stack test \
--fast --no-terminal \
--stack-yaml=${{ matrix.yaml }} \
--resolver=${{ matrix.resolver }} --system-ghc