ci: Minor cleanup

* rename workflow to Stack

* test all branches (provides feedback before opening a PR)

* split into buildenv deps and stack build

* make the deps list more git-friendly; tweak the deps

* use stack from github environment (I've seen the curl fail intermittently)

* use `*.cabal` to minimize diff between our repos

Related: https://github.com/xmonad/X11/pull/75
Related: https://github.com/xmonad/xmonad/issues/283
This commit is contained in:
Tomas Janousek
2021-01-03 14:06:48 +01:00
parent fb390fa9cc
commit caae51c399

View File

@@ -1,10 +1,8 @@
name: Tests
name: Stack
on:
pull_request:
push:
branches:
- master
push:
pull_request:
jobs:
build:
@@ -20,20 +18,29 @@ jobs:
- name: Clone project
uses: actions/checkout@v2
- name: Cache dependencies
- name: Install C dependencies
run: |
set -ex
sudo apt install -y \
libx11-dev \
libxext-dev \
libxinerama-dev \
libxrandr-dev \
libxss-dev \
#
- name: Cache Haskell dependencies
uses: actions/cache@v2
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('xmonad.cabal') }}
key: ${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('*.cabal') }}
restore-keys: |
${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles('stack.yaml') }}-
${{ runner.os }}-${{ matrix.resolver }}-
- name: Build and run tests
shell: bash
- name: Build and test
run: |
set -ex
curl -sSL https://get.haskellstack.org/ | sh -s - -f
sudo apt install -y libasound2 libasound2-dev libxrandr-dev libtinfo-dev
sudo apt install -y libx11-dev libgmp-dev libxss-dev libxft-dev
stack test --fast --no-terminal --resolver=${{ matrix.resolver }}
set -ex
stack test \
--fast --no-terminal \
--resolver=${{ matrix.resolver }}