@@ -0,0 +1,95 @@
1+name: CI
2+
3+# Trigger the workflow on push or pull request, but only for the main branch
4+on:
5+ pull_request:
6+ push:
7+ branches: [master]
8+
9+jobs:
10+ cabal:
11+ name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
12+ runs-on: ${{ matrix.os }}
13+ strategy:
14+ matrix:
15+ os: [ubuntu-latest, macOS-latest]
16+ cabal: ["3.2"]
17+ ghc:
18+ - "8.8.4"
19+ - "8.10.2"
20+ # exclude:
21+ # - os: macOS-latest
22+ # ghc: 8.8.4
23+ # - os: macOS-latest
24+ # ghc: 8.6.5
25+ # - os: windows-latest
26+ # ghc: 8.10.2
27+ # - os: windows-latest
28+ # ghc: 8.6.5
29+
30+ steps:
31+ - uses: actions/checkout@v2
32+
33+ - uses: actions/setup-haskell@v1.1.4
34+ id: setup-haskell-cabal
35+ name: Setup Haskell
36+ with:
37+ ghc-version: ${{ matrix.ghc }}
38+ cabal-version: ${{ matrix.cabal }}
39+
40+ - name: Configure
41+ run: |
42+ cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
43+
44+ - name: Freeze
45+ run: |
46+ cabal freeze
47+
48+ - uses: actions/cache@v2.1.3
49+ name: Cache ~/.cabal/store
50+ with:
51+ path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
52+ key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
53+
54+ - name: Build
55+ run: |
56+ cabal build all
57+
58+ - name: Test
59+ run: |
60+ cabal test all
61+
62+ stack:
63+ name: stack / ghc ${{ matrix.ghc }}
64+ runs-on: ubuntu-latest
65+ strategy:
66+ matrix:
67+ stack: ["2.3.1"]
68+ ghc: ["8.8.4"]
69+
70+ steps:
71+ - uses: actions/checkout@v2
72+
73+ - uses: actions/setup-haskell@v1.1.4
74+ name: Setup Haskell Stack
75+ with:
76+ ghc-version: ${{ matrix.ghc }}
77+ stack-version: ${{ matrix.stack }}
78+
79+ - uses: actions/cache@v2.1.3
80+ name: Cache ~/.stack
81+ with:
82+ path: ~/.stack
83+ key: ${{ runner.os }}-${{ matrix.ghc }}-stack
84+
85+ - name: Install dependencies
86+ run: |
87+ stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
88+
89+ - name: Build
90+ run: |
91+ stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
92+
93+ - name: Test
94+ run: |
95+ stack test --system-ghc