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: on:
pull_request: push:
push: pull_request:
branches:
- master
jobs: jobs:
build: build:
@@ -20,20 +18,29 @@ jobs:
- name: Clone project - name: Clone project
uses: actions/checkout@v2 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 uses: actions/cache@v2
with: with:
path: ~/.stack 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: | restore-keys: |
${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles('stack.yaml') }}- ${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles('stack.yaml') }}-
${{ runner.os }}-${{ matrix.resolver }}- ${{ runner.os }}-${{ matrix.resolver }}-
- name: Build and run tests - name: Build and test
shell: bash
run: | run: |
set -ex set -ex
curl -sSL https://get.haskellstack.org/ | sh -s - -f stack test \
sudo apt install -y libasound2 libasound2-dev libxrandr-dev libtinfo-dev --fast --no-terminal \
sudo apt install -y libx11-dev libgmp-dev libxss-dev libxft-dev --resolver=${{ matrix.resolver }}
stack test --fast --no-terminal --resolver=${{ matrix.resolver }}