Skip to content

Commit

Permalink
move Documentation check to separate job
Browse files Browse the repository at this point in the history
Currently all cabal tests can fail due to missing documentation,
this is undesirable since we can no more distinguish ghc / clash version related problems if documentation does not build
  • Loading branch information
lmbollen committed May 16, 2024
1 parent 48b4b55 commit 3fa467d
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 6 deletions.
43 changes: 41 additions & 2 deletions .ci/build_docs.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,50 @@
#!/bin/bash

me=$(basename "$0")
# If no arguments are given, print usage
if [ $# -eq 0 ]; then
echo "Usage: . $me --clash <version> --ghc <version>"
exit 1
fi

# Parse command line options
while (( "$#" )); do
case "$1" in
--clash)
clash_version="$2"
shift 2
;;
--ghc)
ghc_version="$2"
shift 2
;;
--) # end argument parsing
shift
break
;;
-*|--*=) # unsupported flags
echo "Error: Unsupported flag $1" >&2
exit 1
;;
*) # preserve positional arguments
PARAMS="$PARAMS $1"
shift
;;
esac
done

# Check if clash_version is set, exit if it's not
if [[ -z "$clash_version" ]]; then
echo "Error: clash_version is not set, use --clash_version" >&2
exit 1
fi
set -xeou pipefail

# Build dependencies first, so they don't end up in logs
cabal build \
--constraint=clash-prelude==$clash_version \
--enable-documentation \
--allow-newer=circuit-notation:ghc \
--with-ghc=$ghc \
clash-protocols

# circuit-notation currently _compiles on 8.10, but isn't usable. The only
Expand All @@ -15,7 +54,7 @@ cabal build \
cabal haddock \
--constraint=clash-prelude==$clash_version \
--enable-documentation \
--allow-newer=circuit-notation:ghc \
--with-ghc=$ghc \
clash-protocols \
|& tee haddock_log

Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ jobs:
run: |
.ci/test_cabal.sh
- name: Documentation
run: |
.ci/build_docs.sh
linting:
name: Source code linting
runs-on: ubuntu-latest
Expand All @@ -125,3 +121,15 @@ jobs:
- name: Whitespace
run: |
.ci/test_whitespace.sh
documentation:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build
# Make sure we use supported versions for Clash and GHC
run: |
.ci/build_docs.sh --clash 1.8.1 --ghc 9.6.4

0 comments on commit 3fa467d

Please sign in to comment.