Skip to content

Merge pull request #35 from georgefst/fix-ci-5 #114

Merge pull request #35 from georgefst/fix-ci-5

Merge pull request #35 from georgefst/fix-ci-5 #114

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@v3
- 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.4'
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@v3
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@v3
if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
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)