-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (120 loc) · 4.8 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
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
128
129
name: ms-graph-api-CI
on:
push:
branches: [ '*' ]
pull_request:
branches: [ master ]
defaults: { run: { shell: bash } }
jobs:
tests:
name: CI
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
resolver: [nightly, lts-18, lts-16, lts-14, lts-12]
include:
- resolver: lts-12
ghc: 8.4.4
stack-yaml: stack.yaml
- resolver: lts-14
stack-yaml: stack.yaml
- resolver: lts-16
ghc: 8.8.4
stack-yaml: stack.yaml
- resolver: lts-18
ghc: 8.10.4
# Latest stable for MacOS: ghc-8.8.4
- resolver: lts-16
os: macos-latest
stack-yaml: stack-extra-deps.yaml
# Latest stable for Windows: ghc-8.6.4
- resolver: lts-14
os: windows-latest
stack-yaml: stack-extra-deps.yaml
env:
STACK_YAML: stack.yaml
STACK_ARGS: '--resolver ${{ matrix.resolver }}'
cache-version: v1 # bump up this version to invalidate currently stored cache
steps:
- uses: actions/checkout@v2
- name: Cache
id: cache
uses: actions/cache@v2
if: matrix.os != 'macos-latest'
with:
path: |
~/.stack
.stack-work
massiv-io/.stack-work
key: ${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }}
restore-keys: |
${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }}
- name: Cache
id: cache-macos
uses: actions/cache@v2
if: matrix.os == 'macos-latest'
with:
path: |
~/.stack
key: ${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }}
restore-keys: |
${{ runner.os }}-${{ matrix.resolver }}-${{ env.cache-version }}
- name: Workaround setup-exe-cache failure on macos
if: steps.cache-macos.outputs.cache-hit == 'true' && matrix.os == 'macos-latest'
run: |
rm -r ~/.stack/setup-exe-cache
- name: Windows Cache
id: cache-windows
uses: actions/cache@v2
if: matrix.os == 'windows-latest'
with:
path: |
C:\\Users\\RUNNER~1\\AppData\\Roaming\\stack
C:\\Users\\RUNNER~1\\AppData\\Local\\Programs\\stack
key: ${{ runner.os }}-${{ matrix.resolver }}-programs-${{ env.cache-version }}
restore-keys: |
${{ runner.os }}-${{ matrix.resolver }}-programs-${{ env.cache-version }}
- name: Ubuntu install GHC
if: matrix.ghc != '' && matrix.os == 'ubuntu-latest'
run: |
sudo add-apt-repository ppa:hvr/ghc -y
sudo apt-get update
sudo apt-get install ghc-${{ matrix.ghc }}
- name: Install Stack and local GHC
run: |
set -ex
curl -sSL https://get.haskellstack.org/ | sh -s - -f
curl -sSL https://raw.githubusercontent.com/lehins/utils/786c3fe7e9e1345d7b403019f52e344627224edf/haskell/git-modtime/git-modtime.hs -o git-modtime.hs
[ -n "${{ matrix.ghc }}" ] && [ "${{ matrix.os }}" == "ubuntu-latest" ] && STACK_ARGS="$STACK_ARGS --system-ghc"
[ -n "${{ matrix.stack-yaml }}" ] && STACK_YAML=${{ matrix.stack-yaml }}
stack $STACK_ARGS runghc git-modtime.hs
- name: Build
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
set -ex
[ -n "${{ matrix.ghc }}" ] && [ "${{ matrix.os }}" == "ubuntu-latest" ] && STACK_ARGS="$STACK_ARGS --system-ghc"
[ -n "${{ matrix.stack-yaml }}" ] && STACK_YAML=${{ matrix.stack-yaml }}
if [ "${{ matrix.os }}.${{ matrix.resolver }}" == "ubuntu-latest.lts-14" ] && [ -n "${COVERALLS_TOKEN}" ]; then
stack $STACK_ARGS build massiv-io:tests --coverage --test --no-run-tests --haddock --no-haddock-deps
else
stack $STACK_ARGS build --test --no-run-tests --bench --no-run-benchmarks --haddock --no-haddock-deps
fi
- name: Tests
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
set -ex
[ -n "${{ matrix.ghc }}" ] && [ "${{ matrix.os }}" == "ubuntu-latest" ] && STACK_ARGS="$STACK_ARGS --system-ghc"
[ -n "${{ matrix.stack-yaml }}" ] && STACK_YAML=${{ matrix.stack-yaml }}
if [ "${{ matrix.os }}.${{ matrix.resolver }}" == "ubuntu-latest.lts-14" ] && [ -n "${COVERALLS_TOKEN}" ]; then
stack $STACK_ARGS test massiv-io:tests --coverage --haddock --no-haddock-deps
stack $STACK_ARGS hpc report --all
curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.6.1/shc-linux-x64-8.8.4.tar.bz2 | tar xj shc
./shc --repo-token="$COVERALLS_TOKEN" --partial-coverage --fetch-coverage combined custom
else
stack $STACK_ARGS test massiv-io:doctests
stack $STACK_ARGS test massiv-io:tests
fi