-
-
Notifications
You must be signed in to change notification settings - Fork 30
127 lines (112 loc) · 4.01 KB
/
ci.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: CI
# Trigger the workflow on push or pull request, but only for the master branch
on:
pull_request:
push:
branches:
- master
jobs:
cabal:
name: cabal / ghc-${{ matrix.ghc }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
# ubuntu-22.04 (currently ubuntu-latest) appears to not be able to
# install ghc-8.2.2 with ghcup. Possibly because of
# https://github.com/haskell/actions/issues/133.
# TODO: Need to look into what is going on here, and try upgrading
# back to ubuntu-latest at some point.
# - ubuntu-latest
- ubuntu-20.04
# OSX builds were flakey at some point in the past, so we disabled
# them. pretty-simple doesn't have any interesting system-level
# dependencies, so it is probably okay we aren't testing on OSX.
# - macOS-latest
cabal:
- "3.12.1.0"
ghc:
- "8.0.2"
- "8.2.2"
- "8.4.4"
- "8.6.5"
- "8.8.4"
- "8.10.7"
- "9.0.2"
- "9.2.4"
- "9.4.8"
- "9.6.6"
- "9.8.4"
- "9.10.1"
steps:
- uses: actions/checkout@v2
#if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
- uses: haskell/actions/setup@v2
id: setup-haskell-cabal
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- uses: actions/cache@v1
name: Cache cabal-store
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal
- name: Build
run: |
cabal update
# TODO: We have a problem where cabal is not able to come up with a
# build plan on GHC-9.2 because the ./cabal.project file defines both
# pretty-simple, and ./web as packages. ./web uses a version of jsaddle
# that doesn't seem to work yet on GHC-9.2. It doesn't seem possible
# to tell cabal to just ignore the web package, and only run the solver
# for pretty-simple.
#
# This hacky workaround just deletes the cabal.project file, so that
# cabal doesn't realize there is another package in ./web.
#
# This workaround can likely be removed when we move to a more recent
# version of jsaddle.
rm ./cabal.project
cabal build package:pretty-simple --enable-tests --enable-benchmarks --write-ghc-environment-files=always --flags="buildexample"
- name: Install doctest
run: |
cabal install --ignore-project doctest --flag cabal-doctest
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
- name: Test
run: |
cabal doctest
stack:
name: stack / ubuntu-latest
runs-on: ubuntu-latest
strategy:
matrix:
stack: ["latest"]
steps:
- uses: actions/checkout@v2
#if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
- uses: haskell/actions/setup@v2
name: Setup Haskell Stack
with:
stack-version: ${{ matrix.stack }}
enable-stack: true
- uses: actions/cache@v1
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-stack
- name: Build
run: |
stack build --test --bench --no-run-tests --no-run-benchmarks --flag pretty-simple:buildexample
nix-build-web:
name: Nix build GHCJS web
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v16
with:
extra_nix_config: |
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= miso-haskell.cachix.org-1:6N2DooyFlZOHUfJtAx1Q09H0P5XXYzoxxQYiwn6W1e8=
substituters = https://cache.nixos.org/ https://miso-haskell.cachix.org
- name: Build web
run: nix-build ./web