Skip to content

Commit c06a221

Browse files
committed
Add Github workflows
1 parent f9a3bf4 commit c06a221

File tree

2 files changed

+114
-0
lines changed

2 files changed

+114
-0
lines changed

.github/workflows/cabal.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Cabal CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
name: cabal ${{ matrix.ghc }}
12+
runs-on: ubuntu-16.04
13+
strategy:
14+
matrix:
15+
ghc: ["8.8.1", "8.6.5", "8.6.4", "8.6.3", "8.6.2"]
16+
cabal: ["3.0"]
17+
18+
steps:
19+
- uses: actions/checkout@v1
20+
- uses: actions/setup-haskell@v1
21+
name: Setup Haskell
22+
with:
23+
ghc-version: ${{ matrix.ghc }}
24+
cabal-version: ${{ matrix.cabal }}
25+
26+
- uses: actions/cache@v1
27+
name: Cache ~/.cabal/packages
28+
with:
29+
path: ~/.cabal/packages
30+
key: cabal-packages-${{ matrix.ghc }}
31+
32+
- uses: actions/cache@v1
33+
name: Cache ~/.cabal/store
34+
with:
35+
path: ~/.cabal/store
36+
key: cabal-store-${{ matrix.ghc }}
37+
38+
- uses: actions/cache@v1
39+
name: Cache dist-newstyle
40+
with:
41+
path: dist-newstyle
42+
key: dist-newstyle-${{ matrix.ghc }}
43+
44+
- name: Install dependencies
45+
run: |
46+
cabal update
47+
- name: Build
48+
run: |
49+
cabal new-build

.github/workflows/stack.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Stack CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: "0 0 * * 1"
8+
9+
jobs:
10+
build:
11+
name: stack ${{ matrix.plan.resolver }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, macOS-latest]
15+
plan:
16+
- { build: stack, resolver: "lts-13" } # redundant because lts-14 checks ghc-8.6 already
17+
- { build: stack, resolver: "lts-14" } # ghc-8.6.5
18+
#- { build: stack, resolver: "nightly" }
19+
include: []
20+
exclude:
21+
- os: macOS-latest
22+
plan:
23+
build: cabal
24+
25+
runs-on: ${{ matrix.os }}
26+
steps:
27+
- name: Install OS Packages
28+
uses: mstksg/get-package@v1
29+
with:
30+
apt-get: ${{ matrix.apt-get }}
31+
brew: ${{ matrix.brew }}
32+
- uses: actions/checkout@v1
33+
34+
- name: Setup stack
35+
uses: mstksg/setup-stack@v1
36+
37+
- uses: actions/cache@v1
38+
name: Cache .stack-work
39+
with:
40+
path: .stack-work
41+
key: stack-work
42+
43+
- uses: actions/cache@v1
44+
name: Cache ~/.stack
45+
with:
46+
path: ~/.stack
47+
key: stack
48+
49+
- name: Install dependencies
50+
run: |
51+
set -ex
52+
stack --no-terminal --install-ghc --resolver $ARGS test --bench --only-dependencies
53+
set +ex
54+
env:
55+
ARGS: ${{ matrix.plan.resolver }}
56+
BUILD: ${{ matrix.plan.build }}
57+
58+
- name: Build
59+
run: |
60+
set -ex
61+
stack --no-terminal --resolver $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps
62+
set +ex
63+
env:
64+
ARGS: ${{ matrix.plan.resolver }}
65+
BUILD: ${{ matrix.plan.build }}

0 commit comments

Comments
 (0)