Skip to content

Commit c64bbb9

Browse files
committed
Merge in latest and fix conflicts.
2 parents 75da485 + 04e4de5 commit c64bbb9

File tree

219 files changed

+7189
-1380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+7189
-1380
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# These are supported funding model platforms
22

3-
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
3+
github: [arianvp]
44
patreon: # Replace with a single Patreon username
55
open_collective: # Replace with a single Open Collective username
66
ko_fi: # Replace with a single Ko-fi username

.github/run-ghcjs-tests.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
#
3+
# cabal v2-test does not work with GHCJS
4+
# See: https://github.com/haskell/cabal/issues/6175
5+
#
6+
# This invokes cabal-plan to figure out test binaries, and invokes them with node.
7+
8+
cabal-plan list-bins '*:test:*' | while read -r line
9+
do
10+
testpkg=$(echo "$line" | perl -pe 's/:.*//')
11+
testexe=$(echo "$line" | awk '{ print $2 }')
12+
echo "testing $textexe in package $textpkg"
13+
(cd "$testpkg" && node "$testexe".jsexe/all.js)
14+
done

.github/workflows/master.yml

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
name: CI
2+
3+
# Trigger the workflow on push or pull request, but only for the master 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]
16+
cabal: ["3.4"]
17+
ghc:
18+
- "8.6.5"
19+
- "8.8.4"
20+
- "8.10.7"
21+
- "9.0.1"
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
26+
- uses: haskell/actions/setup@v1
27+
id: setup-haskell-cabal
28+
name: Setup Haskell
29+
with:
30+
ghc-version: ${{ matrix.ghc }}
31+
cabal-version: ${{ matrix.cabal }}
32+
33+
- name: Freeze
34+
run: |
35+
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
36+
cabal freeze
37+
38+
- uses: actions/[email protected]
39+
name: Cache ~/.cabal/store and dist-newstyle
40+
with:
41+
path: |
42+
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
43+
dist-newstyle
44+
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
45+
restore-keys: |
46+
${{ runner.os }}-${{ matrix.ghc }}-
47+
48+
- name: Configure
49+
run: |
50+
# Using separate store-dir because default one already has 'ghc-paths' package installed
51+
# with hardcoded path to ghcup's GHC path (which it was built with). This leads to failure in
52+
# doctest, as it tries to invoke that GHC, and it doesn't exist here.
53+
cabal --store-dir /tmp/cabal-store install --ignore-project -j2 doctest --constraint='doctest ^>=0.18'
54+
55+
- name: Build
56+
run: |
57+
cabal build all
58+
59+
- name: Test
60+
run: |
61+
cabal test all
62+
63+
- name: Run doctests
64+
# doctests are broken on GHC 9 due to compiler bug:
65+
# https://gitlab.haskell.org/ghc/ghc/-/issues/19460
66+
continue-on-error: ${{ matrix.ghc == '9.0.1' }}
67+
run: |
68+
# Necessary for doctest to be found in $PATH
69+
export PATH="$HOME/.cabal/bin:$PATH"
70+
71+
# Filter out base-compat-batteries from .ghc.environment.*, as its modules
72+
# conflict with those of base-compat.
73+
#
74+
# FIXME: This is an ugly hack. Ultimately, we'll want to use cabal-doctest
75+
# (or cabal v2-doctest, if it ever lands) to provide a clean GHC environment.
76+
# This might allow running doctests in GHCJS build as well.
77+
perl -i -e 'while (<ARGV>) { print unless /package-id\s+(base-compat-batteries)-\d+(\.\d+)*/; }' .ghc.environment.*
78+
79+
(cd servant && doctest src)
80+
(cd servant-client && doctest src)
81+
(cd servant-client-core && doctest src)
82+
(cd servant-http-streams && doctest src)
83+
(cd servant-docs && doctest src)
84+
(cd servant-foreign && doctest src)
85+
(cd servant-server && doctest src)
86+
(cd servant-machines && doctest src)
87+
(cd servant-conduit && doctest src)
88+
(cd servant-pipes && doctest src)
89+
90+
stack:
91+
name: stack / ghc ${{ matrix.ghc }}
92+
runs-on: ubuntu-latest
93+
strategy:
94+
matrix:
95+
stack: ["2.7.3"]
96+
ghc: ["8.10.4"]
97+
98+
steps:
99+
- uses: actions/checkout@v2
100+
101+
- uses: haskell/actions/setup@v1
102+
name: Setup Haskell Stack
103+
with:
104+
ghc-version: ${{ matrix.ghc }}
105+
stack-version: ${{ matrix.stack }}
106+
107+
- uses: actions/[email protected]
108+
name: Cache ~/.stack
109+
with:
110+
path: ~/.stack
111+
key: ${{ runner.os }}-${{ matrix.ghc }}-stack
112+
113+
- name: Install dependencies
114+
run: |
115+
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
116+
117+
- name: Build
118+
run: |
119+
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
120+
121+
- name: Test
122+
run: |
123+
stack test --system-ghc
124+
125+
ghcjs:
126+
name: ubuntu-latest / ghcjs 8.6
127+
runs-on: "ubuntu-latest"
128+
129+
steps:
130+
- uses: actions/checkout@v2
131+
- uses: cachix/install-nix-action@v13
132+
with:
133+
extra_nix_config: |
134+
trusted-public-keys = ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=1aba6f367982bd6dd78ec2fda75ab246a62d32c5 cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
135+
substituters = https://nixcache.reflex-frp.org https://cache.nixos.org/
136+
- name: Setup
137+
run: |
138+
# Override cabal.project with the lightweight GHCJS one
139+
cp cabal.ghcjs.project cabal.project
140+
cat cabal.project
141+
nix-shell ghcjs.nix --run "cabal v2-update && cabal v2-freeze"
142+
143+
- uses: actions/[email protected]
144+
name: Cache ~/.cabal/store and dist-newstyle
145+
with:
146+
path: |
147+
~/.cabal/store
148+
dist-newstyle
149+
key: ${{ runner.os }}-ghcjs8.6-${{ hashFiles('cabal.project.freeze') }}
150+
restore-keys: |
151+
${{ runner.os }}-ghcjs8.6-
152+
153+
- name: Build
154+
run: |
155+
nix-shell ghcjs.nix --run "cabal v2-build --ghcjs --enable-tests --enable-benchmarks all"
156+
157+
- name: Tests
158+
run: |
159+
nix-shell ghcjs.nix --run ".github/run-ghcjs-tests.sh"

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
**/*/dist
2+
*~
23
dist-*
34
.ghc.environment.*
45
/bin
@@ -29,6 +30,10 @@ doc/_build
2930
doc/venv
3031
doc/tutorial/static/api.js
3132
doc/tutorial/static/jq.js
33+
shell.nix
34+
35+
# nix
36+
result*
3237

3338
# local versions of things
3439
servant-multipart

0 commit comments

Comments
 (0)