Skip to content

Commit 16c8f82

Browse files
committed
Add a markdown-doctest CI
1 parent bf35f43 commit 16c8f82

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
- name: Checkout the current branch
31+
uses: actions/checkout@v2
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Create env files for ghci
36+
run: cabal build streamly --write-ghc-environment-files=always
37+
38+
- name: Run markdown-doctest
39+
run: |
40+
cabal install markdown-doctest --project-file=cabal.project.markdown-doctest --installdir=./ --overwrite-policy=always
41+
find . -type f -name "*.md" -print0 | while IFS= read -r -d '' file; do echo "CMD: ./markdown-doctest $file" && ./markdown-doctest "$file" || break; 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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source-repository-package
2+
type: git
3+
location: https://github.com/composewell/markdown-doctest.git
4+
tag: 05dcf5f03128c49b66cf7c7778f567da1990014c

0 commit comments

Comments
 (0)