-
Notifications
You must be signed in to change notification settings - Fork 9
63 lines (53 loc) · 1.87 KB
/
haskell.yml
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
59
60
61
62
63
name: Haskell CI
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
permissions:
contents: read
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
with:
enable-stack: true
- name: Cache Haskell stack
uses: actions/cache@v4
env:
cache-name: cache-stack
with:
path: ~/.stack
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('lib/haskell/**/package.yaml','lib/haskell/**/stack.yaml.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('lib/haskell/**/package.yaml','lib/haskell/**/stack.yaml.lock') }}
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('lib/haskell/**/package.yaml') }}
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Ubuntu Prerequisites (libpcre)
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install libpcre3-dev liblzma-dev
- name: Install MacOS Prerequisites (libpcre)
if: startsWith(matrix.os, 'macOS')
run: |
wget https://ftp.exim.org/pub/pcre/pcre-8.45.tar.gz
tar -xvf pcre-8.45.tar.gz
cd pcre-8.45
./configure
make
sudo make install
- name: Build and test
run: stack test
working-directory: lib/haskell
- name: Check that generate .cabal files are up-to-date
if: startsWith(matrix.os, 'ubuntu')
run: |
curl -sSL https://raw.githubusercontent.com/sol/hpack/main/get-hpack.sh | bash
find -name 'package.yaml' -exec hpack '{}' \; && git diff --color --exit-code