summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2020-08-07 21:14:42 +0100
committerGitHub <noreply@github.com>2020-08-07 21:14:42 +0100
commit2eb42cde8999302220df8febd359108a6c6f7bc5 (patch)
treeb9dc066cf861394fa05ba80f99158e815d87c7b9
parentc960f25417749b808f41c39f8bbf610639dc76f8 (diff)
downloadxmobar-2eb42cde8999302220df8febd359108a6c6f7bc5.tar.gz
xmobar-2eb42cde8999302220df8febd359108a6c6f7bc5.tar.bz2
Github action for running hlint and tests
-rw-r--r--.github/workflows/haskell.yml58
1 files changed, 58 insertions, 0 deletions
diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml
new file mode 100644
index 0000000..ace7cac
--- /dev/null
+++ b/.github/workflows/haskell.yml
@@ -0,0 +1,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