-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (75 loc) · 2.12 KB
/
build.yaml
File metadata and controls
86 lines (75 loc) · 2.12 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Build
on:
push:
schedule:
- cron: '0 8 * * *'
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ghc: ['8.8.4', '8.10.7', '9.0.1']
cabal: ['3.4']
os:
- 'ubuntu-18.04'
- 'ubuntu-20.04'
- 'macOS-latest'
# - 'windows-latest' # windows builds generally work but are flaky on the github runners
steps:
# Setup
- name: Checkout repository
uses: actions/checkout@v2
- name: Install GHC and Cabal
uses: haskell/actions/setup@v1.2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Configure project
shell: bash
run: |
cat > cabal.project.local <<EOF
write-ghc-environment-files: always
package merkle-log
documentation: True
benchmarks: True
tests: True
EOF
- name: Install word list
if: contains(matrix.os, 'ubuntu')
run: sudo apt-get install -y wamerican
# Restore Packages from Caches
- uses: actions/cache@v2.1.6
name: Cache dist-newstyle
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ matrix.os }}-${{ matrix.ghc }}-0-cabal
# Build
- name: Update package database
run: cabal update
- name: Configure build
run: |
cabal build all --dry-run
cabal freeze
- name: Install build dependencies
run: cabal build --only-dependencies
- name: Build library
run: cabal build
# Tests
- name: Run Tests
run: cabal test test:tests
- name: Run doctest Tests
# doctest is flaky on old versions of ubuntu:
# libtinfo.so.6: cannot open shared object file: No such file or directory
if: "(matrix.os != 'ubuntu-18.04') && (matrix.ghc != '8.8.4')"
run: cabal test test:doctests
# Benchmarks
- name: Run Benchmarks
run: cabal bench internal-benchmarks
- name: Run Spellchecker Benchmarks
if: "! contains(matrix.os, 'windows')"
run: cabal bench spellchecker