Skip to content

Update CI

Update CI #4

Workflow file for this run

name: Haskell CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: main
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set user input permissions
run: sudo usermod -a -G input $USER
- name: Set up GHC
uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: '9.6'
cabal-version: '3.10'
cabal-update: true
- name: Install libevdev
run: sudo apt install -y libevdev-dev
- name: Configure the build
run: |
cabal configure --enable-tests --enable-benchmarks --disable-documentation
cabal build all --dry-run
- name: Restore cached dependencies
uses: actions/cache/restore@v4
id: cache
env:
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-
- name: Install dependencies
run: cabal build all --only-dependencies
- name: Save cached dependencies
uses: actions/cache/save@v4
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- name: Build
run: cabal build all
- name: Run tests
run: |
cabal build test
sudo $(cabal list-bin test)
- name: Check cabal files
run: (cd evdev && cabal check) && (cd evdev-streamly && cabal check)
- name: Build documentation
run: cabal haddock all