Skip to content

Commit a1fe99f

Browse files
committed
Add a markdown-doctest CI
1 parent ecacca1 commit a1fe99f

3 files changed

Lines changed: 59 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Markdown Doctest
2+
3+
on: pull_request
4+
5+
jobs:
6+
markdown-doctest:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
12+
- name: Download ghc
13+
run: |
14+
GHCUP_VER=0.1.20.0
15+
curl -sL -o ./ghcup https://downloads.haskell.org/~ghcup/$GHCUP_VER/x86_64-linux-ghcup-$GHCUP_VER
16+
chmod +x ./ghcup
17+
GHCVER=9.8.1
18+
./ghcup install ghc $GHCVER
19+
./ghcup set ghc $GHCVER
20+
cabal update
21+
22+
- uses: actions/cache@v4
23+
name: Cache ~/.cabal
24+
with:
25+
path: |
26+
~/.cabal
27+
# Bump the key version to clear the cache
28+
key: cache-v2
29+
30+
- uses: actions/checkout@v4
31+
with:
32+
ref: ${{ github.event.pull_request.head.sha }}
33+
34+
- name: Create env files for ghci
35+
run: cabal build streamly --write-ghc-environment-files=always
36+
37+
- name: Run markdown-doctest
38+
run: |
39+
echo "Commit: $(git rev-parse HEAD)"
40+
cabal install markdown-doctest --project-file=cabal.project.markdown-doctest --installdir=./ --overwrite-policy=always
41+
find ./docs -type f -name "*.md" -print0 | while IFS= read -r -d '' file; do echo "CMD: ./markdown-doctest $file" && ./markdown-doctest "$file" || exit 1; done
42+
find ./core/docs -type f -name "*.md" -print0 | while IFS= read -r -d '' file; do echo "CMD: ./markdown-doctest $file" && ./markdown-doctest "$file" || exit 1; done

.packcheck.ignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.github/workflows/haskell.yml
44
.github/workflows/regression-check.yml
55
.github/workflows/packdiff.yml
6+
.github/workflows/markdown-doctest.yml
67
.gitignore
78
.hlint.ignore
89
.hlint.yaml
@@ -23,6 +24,7 @@ cabal.project.hpc-coveralls
2324
cabal.project.O0
2425
cabal.project.report
2526
cabal.project.packdiff
27+
cabal.project.markdown-doctest
2628
cabal.project.streamly
2729
cabal.project.Werror
2830
cabal.project.Werror-nocode

cabal.project.markdown-doctest

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
source-repository-package
2+
type: git
3+
location: https://github.com/composewell/streamly.git
4+
tag: d330733874cb57a81ddde444b2b77bac875f3633
5+
6+
source-repository-package
7+
type: git
8+
location: https://github.com/composewell/streamly.git
9+
tag: d330733874cb57a81ddde444b2b77bac875f3633
10+
subdir: core
11+
12+
source-repository-package
13+
type: git
14+
location: https://github.com/composewell/markdown-doctest.git
15+
tag: 05dcf5f03128c49b66cf7c7778f567da1990014c

0 commit comments

Comments
 (0)