diff --git a/.ci/build_docs.sh b/.ci/build_docs.sh index aebbc724..fef9fc15 100755 --- a/.ci/build_docs.sh +++ b/.ci/build_docs.sh @@ -1,4 +1,38 @@ #!/bin/bash + +# If no arguments are given, print usage +if [ $# -eq 0 ]; then + echo "Usage: --clash_version " + exit 1 +fi + +# Parse command line options +while (( "$#" )); do + case "$1" in + --clash_version) + clash_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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04391429..b1126674 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -125,3 +121,14 @@ jobs: - name: Whitespace run: | .ci/test_whitespace.sh + + documentation: + name: Documentation clash_version 9.6.4 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build + run: | + .ci/build_docs.sh --clash_version 1.8.1