summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows/haskell.yml
blob: ace7cac1de75c73708b3206ae1ec99d46d836bde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Haskell CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
  workflow_dispatch:

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        cabal: ["3.2"]
        ghc: ["8.4", "8.6.5", "8.8.3", "8.10.1"]
    env:
      CONFIG: "--enable-tests --enable-benchmarks -fall_extensions"
  
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-haskell@v1
      with:
        ghc-version: ${{ matrix.ghc }}
        cabal-version: ${{ matrix.cabal }}

    - 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 packages
      run: | 
        sudo apt-get install -y libasound2-dev libxpm-dev libmpd-dev libxrandr-dev
        sudo apt-get install -y happy c2hs hspec-discover      
        
    - name: Install dependencies
      run: |
        cabal update
        cabal build --dependencies-only $CONFIG

    - name: Build
      run: cabal build $CONFIG
      
    - name: Run hlint
      run: |
        wget https://raw.github.com/ndmitchell/hlint/master/misc/travis.sh
        sh ./travis.sh src
    - name: Run tests
      run: cabal test