Skip to content

Commit

Permalink
fix CI?
Browse files Browse the repository at this point in the history
  • Loading branch information
georgefst committed Sep 6, 2023
1 parent dafed96 commit e90bc92
Showing 1 changed file with 49 additions and 37 deletions.
86 changes: 49 additions & 37 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,54 @@ on:

jobs:
build:

name: main
runs-on: ubuntu-latest

steps:

- name: Set user input permissions
run: sudo usermod -a -G input $USER

- uses: actions/checkout@v2
- uses: actions/setup-haskell@v1
with:
ghc-version: '9.4.5'
cabal-version: '3.6.2.0'

- name: Install libevdev
run: sudo apt install -y libevdev-dev

- name: Cache
uses: actions/cache@v1
env:
cache-name: cache-cabal
with:
path: ~/.cabal
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: |
cabal update
cabal build --only-dependencies --enable-tests --enable-benchmarks all
- name: Build
run: cabal build --enable-tests --enable-benchmarks all
- name: Run tests
run: |
cabal build test
find . -name test -type f -executable -exec sudo {} \;
- 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 --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
find . -name test -type f -executable -exec sudo {} \;

0 comments on commit e90bc92

Please sign in to comment.