Skip to content

Commit

Permalink
clean up & rename check_tech_doc.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
gspetro-NOAA committed Nov 4, 2024
1 parent 9fdfcbd commit 6e2d202
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/bin/bash
# This script rebuilds technical documentation for the ush and tests/WE2E Python scripts
# The build will fail if there are warnings.
# Warnings may be caused by incomplete or nonexistent documentation
# as well as by minor issues such as broken external links that need to be fixed or removed
# This script recreates technical documentation for the ush and tests/WE2E Python scripts
# If the tech docs produced here do not match the branch's contents, the script will fail

# Install prerequisites
sudo apt-get install python3-sphinx
Expand All @@ -19,22 +17,13 @@ sphinx-apidoc -fM -o ./ush ../../ush
sphinx-apidoc -fM -o ./tests/WE2E ../../tests/WE2E

# Check for mismatch between what comes out of this action and what is in the PR.
diff=`git diff ${BRANCH_NAME} origin/develop`
echo "${diff}"
status=`git status`
echo "${status}"

if [ -n status ]; then
echo "${status}"
echo "${status}\n"
echo "Please update your Technical Documentation RST files."
exit 1
else
echo "Technical documentation is up-to-date."
exit 0
fi

# Check output from git diff command^ Why no diff on calculate_cost.rst?


# May be able eventually to add an action that adds the properly built docs to the PR or the target branch

6 changes: 2 additions & 4 deletions .github/workflows/doc_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ on:
jobs:
doc_tests:
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Update tech docs
run: .github/scripts/update_tech_doc.sh
- name: Check tech docs
run: .github/scripts/check_tech_doc.sh
- name: Build documentation
run: |
cd doc
Expand Down

0 comments on commit 6e2d202

Please sign in to comment.