Skip to content

Commit 1617625

Browse files
committed
Add GitHub workflow for testing
1 parent 2dfa834 commit 1617625

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ defaults:
77
on:
88
release:
99
types: [created]
10+
1011
jobs:
1112

1213
build:

.github/workflows/test.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Testing
2+
3+
on: [push, pull_request]
4+
jobs:
5+
test:
6+
runs-on: ${{ matrix.os }}
7+
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
ghc: ['8.10.2', '8.10.1', '8.8.4', '8.8.3', '8.8.2', '8.6.5', '8.6.4']
12+
os: [ubuntu-latest, macOS-latest, windows-latest]
13+
exclude:
14+
- os: windows-latest
15+
ghc: '8.10.2' # broken due to https://gitlab.haskell.org/ghc/ghc/-/issues/18550
16+
- os: windows-latest
17+
ghc: '8.8.4' # also fails due to segfault :(
18+
- os: windows-latest
19+
ghc: '8.8.3' # fails due to segfault
20+
- os: windows-latest
21+
ghc: '8.8.2' # fails due to error with Cabal
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
with:
26+
submodules: true
27+
- uses: haskell/setup-haskell@v1
28+
with:
29+
ghc-version: ${{ matrix.ghc }}
30+
cabal-version: '3.2'
31+
32+
- name: Cache Cabal
33+
uses: actions/cache@v2
34+
env:
35+
cache-name: cache-cabal
36+
with:
37+
path: ~/.cabal/
38+
key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
39+
restore-keys: |
40+
${{ runner.os }}-build-${{ env.cache-name }}-
41+
${{ runner.os }}-build-
42+
${{ runner.os }}-
43+
44+
45+
- name: Shorten binary names
46+
shell: bash
47+
run: |
48+
sed -i.bak -e 's/haskell-language-server/hls/g' \
49+
-e 's/haskell_language_server/hls/g' \
50+
haskell-language-server.cabal
51+
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
52+
src/**/*.hs exe/*.hs
53+
54+
- name: Build
55+
run: cabal build
56+
- name: Test
57+
run: cabal test
58+

0 commit comments

Comments
 (0)