From 2376db8f975cbe22e27531a207f97b5b9e3e5f06 Mon Sep 17 00:00:00 2001 From: stertooy <5571903+stertooy@users.noreply.github.com> Date: Sat, 26 Jul 2025 00:12:04 +0200 Subject: [PATCH 1/7] Create doc_checker.g --- doc_checker.g | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 doc_checker.g diff --git a/doc_checker.g b/doc_checker.g new file mode 100644 index 0000000..c77d193 --- /dev/null +++ b/doc_checker.g @@ -0,0 +1,23 @@ +Read("PackageInfo.g"); +doc_infos := GAPInfo.PackageInfoCurrent.PackageDoc; +filenames := [ "HTMLStart", "SixFile" ${{ inputs.use-latex == 'true' && ', "PDFFile"' || '' }}]; + +if IsRecord(doc_infos) then + doc_infos := [doc_infos]; +fi; + +for doc_info in doc_infos do + for filename in filenames do + if not IsExistingFile( doc_info.(filename) ) then + Error( + Concatenation( + "The documentation has supposedly been built, but the file ", + doc_info.(filename), + " specified in PackageDoc.", + filename, + " does not exist." + ) + ); + fi; + od; +od; From 1ba45eb37c3894b2a02b7f6314fada8d23925a4c Mon Sep 17 00:00:00 2001 From: stertooy <5571903+stertooy@users.noreply.github.com> Date: Sat, 26 Jul 2025 00:13:48 +0200 Subject: [PATCH 2/7] Update action.yml --- action.yml | 37 +++++-------------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/action.yml b/action.yml index ce3bbaf..e2c26d7 100644 --- a/action.yml +++ b/action.yml @@ -55,7 +55,7 @@ runs: shell: bash run: | if [ -f "makedoc.g" ]; then - $GAP makedoc.g -c "QUIT;" 2>&1 | tee output.log + $GAP makedoc.g -c "QUIT;" 2>&1 | tee $RUNNER_TEMP/output.log elif [ -x "doc/make_doc" ]; then # If the package is called , then the script # most likely assumes that it has been called from the within the @@ -65,7 +65,7 @@ runs: # So we create symlinks to some potentially-useful GAP directories. [ -d ../../doc ] && echo "../../doc exists" || ln -s $GAPROOT/doc ../../doc [ -d ../../etc ] && echo "../../etc exists" || ln -s $GAPROOT/etc ../../etc - cd doc && ./make_doc 2>&1 | tee output.log + cd doc && ./make_doc 2>&1 | tee $RUNNER_TEMP/output.log elif [ -f "doc/make_doc" ]; then echo "doc/make_doc exists but is not executable!" exit 1 @@ -84,39 +84,12 @@ runs: # label warnings are sometimes false positives. Moreover, GAPDoc can # identify this issues, hence we ignore the ones from LaTeX. run: | - if grep -i -e "warning\b" output.log | grep -qiv "LaTeX Warning: Label(s) may have changed."; then + if grep -i -e "warning\b" $RUNNER_TEMP/output.log | grep -qiv "LaTeX Warning: Label(s) may have changed."; then echo "Warnings were found when building the documentation!" - grep -i -e "warning\b" output.log + grep -i -e "warning\b" $RUNNER_TEMP/output.log exit 1 fi - name: "Check documentation is compiled" shell: bash run: | - cat > __DOC_CHECKER__.g < Date: Sat, 26 Jul 2025 20:16:29 +0200 Subject: [PATCH 3/7] Delete doc_checker.g --- doc_checker.g | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 doc_checker.g diff --git a/doc_checker.g b/doc_checker.g deleted file mode 100644 index c77d193..0000000 --- a/doc_checker.g +++ /dev/null @@ -1,23 +0,0 @@ -Read("PackageInfo.g"); -doc_infos := GAPInfo.PackageInfoCurrent.PackageDoc; -filenames := [ "HTMLStart", "SixFile" ${{ inputs.use-latex == 'true' && ', "PDFFile"' || '' }}]; - -if IsRecord(doc_infos) then - doc_infos := [doc_infos]; -fi; - -for doc_info in doc_infos do - for filename in filenames do - if not IsExistingFile( doc_info.(filename) ) then - Error( - Concatenation( - "The documentation has supposedly been built, but the file ", - doc_info.(filename), - " specified in PackageDoc.", - filename, - " does not exist." - ) - ); - fi; - od; -od; From 4359d606afec93f3398ba43e7396a9b28300f17b Mon Sep 17 00:00:00 2001 From: stertooy <5571903+stertooy@users.noreply.github.com> Date: Sat, 26 Jul 2025 20:17:20 +0200 Subject: [PATCH 4/7] Update action.yml --- action.yml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index e2c26d7..a4bcd45 100644 --- a/action.yml +++ b/action.yml @@ -92,4 +92,31 @@ runs: - name: "Check documentation is compiled" shell: bash run: | - $GAP $GITHUB_ACTION_PATH/doc_checker.g -c "QUIT;" + cat > $GITHUB_ACTION_PATH/__DOC_CHECKER__.g < Date: Sat, 26 Jul 2025 21:46:10 +0200 Subject: [PATCH 5/7] Update action.yml --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index a4bcd45..94c47d8 100644 --- a/action.yml +++ b/action.yml @@ -92,7 +92,7 @@ runs: - name: "Check documentation is compiled" shell: bash run: | - cat > $GITHUB_ACTION_PATH/__DOC_CHECKER__.g < $RUNNER_TEMP/__DOC_CHECKER__.g < Date: Wed, 27 Aug 2025 14:46:59 +0200 Subject: [PATCH 6/7] Remove auxiliary files made by pdflatex --- action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/action.yml b/action.yml index 94c47d8..6f5ef75 100644 --- a/action.yml +++ b/action.yml @@ -120,3 +120,8 @@ runs: EOF $GAP $RUNNER_TEMP/__DOC_CHECKER__.g -c "QUIT;" + + - name: "Remove auxiliary files" + shell: bash + run: | + find doc \( -name '*.aux' -o -name '*.bbl' -o -name '*.blg' -o -name '*.brf' -o -name '*.idx' -o -name '*.ilg' -o -name '*.ind' -o -name '*.log' -o -name '*.out' -o -name '*.pnr' -o -name '*.toc' -o -name '*.tst' \) -exec rm -f {} + From 32c4c999f62f7e368d99f6f0d303df350f76749d Mon Sep 17 00:00:00 2001 From: stertooy <5571903+stertooy@users.noreply.github.com> Date: Wed, 27 Aug 2025 14:48:21 +0200 Subject: [PATCH 7/7] Test for any leftover files in CI --- .github/workflows/CI.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c1a8b57..d36bbb2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -31,3 +31,9 @@ jobs: - uses: ./this-action/ with: use-latex: ${{ matrix.use-latex }} + - name: Check for unwanted files + shell: bash + run: | + test ! -f output.log + test ! -f __DOC_CHECKER__.g + find doc \( -name '*.aux' -o -name '*.bbl' -o -name '*.blg' -o -name '*.brf' -o -name '*.idx' -o -name '*.ilg' -o -name '*.ind' -o -name '*.log' -o -name '*.out' -o -name '*.pnr' -o -name '*.toc' -o -name '*.tst' \) -exec test ! -f {} +