@@ -37,14 +37,17 @@ jobs:
3737 # Bump the key version to clear the cache
3838 key : cache-cabal-packages
3939
40- - name : Cache cabal build dependencies (non-Windows)
40+ # NOTE: we need the cabal state as well because the executable may depend
41+ # on shared libraries in the cabal store.
42+ - name : Cache markdown-doctest (non-Windows)
4143 uses : actions/cache@v4
4244 if : runner.os != 'Windows'
4345 with :
4446 path : |
4547 ~/.local/state/cabal
48+ ~/.local/bin
4649 # Bump the key version to clear the cache
47- key : markdown-doctest-deps
50+ key : markdown-doctest-ghc-${{ env.GHCVER }}
4851
4952 - uses : actions/checkout@v4
5053 with :
6568 - name : Create env files for ghci
6669 run : cabal build streamly --write-ghc-environment-files=always
6770
71+ - name : Add ~/.local/bin to PATH
72+ run : echo "$HOME/.local/bin" >> $GITHUB_PATH
73+
6874 - name : Run markdown-doctest
6975 run : |
7076 echo "Commit: $(git rev-parse HEAD)"
71- cabal install markdown-doctest --project-file=cabal.project.markdown-doctest --installdir=./ --overwrite-policy=always
72- 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
73- 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
77+ if [ ! -f ~/.local/bin/markdown-doctest ]; then
78+ mkdir -p ~/.local/bin
79+ cabal install markdown-doctest --project-file=cabal.project.markdown-doctest --installdir=~/.local/bin --overwrite-policy=always
80+ fi
81+ find ./docs ./core/docs -type f -name "*.md" -print0 | while IFS= read -r -d '' file; do
82+ echo "CMD: markdown-doctest $file" && markdown-doctest "$file" || exit 1
83+ done
0 commit comments