From 6e2d202cc0e532afd1055435d75aeea084d2d9a0 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Mon, 4 Nov 2024 15:37:46 -0500 Subject: [PATCH] clean up & rename check_tech_doc.sh --- .../{update_tech_doc.sh => check_tech_doc.sh} | 17 +++-------------- .github/workflows/doc_tests.yaml | 6 ++---- 2 files changed, 5 insertions(+), 18 deletions(-) rename .github/scripts/{update_tech_doc.sh => check_tech_doc.sh} (54%) diff --git a/.github/scripts/update_tech_doc.sh b/.github/scripts/check_tech_doc.sh similarity index 54% rename from .github/scripts/update_tech_doc.sh rename to .github/scripts/check_tech_doc.sh index 8b3e9b72d..f6c3bb5c1 100755 --- a/.github/scripts/update_tech_doc.sh +++ b/.github/scripts/check_tech_doc.sh @@ -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 @@ -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 - diff --git a/.github/workflows/doc_tests.yaml b/.github/workflows/doc_tests.yaml index 1c83ff095..59595bcba 100644 --- a/.github/workflows/doc_tests.yaml +++ b/.github/workflows/doc_tests.yaml @@ -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