Skip to content

Commit 0cff03b

Browse files
authored
Merge branch 'master' into ci-fixes
2 parents 4ff4167 + 4ff0bef commit 0cff03b

30 files changed

Lines changed: 399 additions & 241 deletions

.github/workflows/docs.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0 # Full history for per-page last-updated dates
1820

1921
# We build doxygen from source because of
2022
# https://github.com/doxygen/doxygen/issues/9016
@@ -35,6 +37,12 @@ jobs:
3537
cmake -S . -B build -G Ninja --install-prefix="$(pwd)/build/install" -D MFC_DOCUMENTATION=ON
3638
ninja -C build install
3739
40+
- name: Verify essential site files
41+
run: |
42+
for f in index.html 404.html robots.txt; do
43+
test -f "build/install/docs/mfc/$f" || { echo "Missing $f"; exit 1; }
44+
done
45+
3846
- name: Upload Built Documentation Artifact
3947
uses: actions/upload-artifact@v4
4048
with:
@@ -51,20 +59,14 @@ jobs:
5159
base-url-path: https://mflowcode.github.io/
5260
path-to-root: build/install/docs/mfc
5361
include-pdf: false
54-
sitemap-format: txt
62+
sitemap-format: xml
5563

5664
- name: Output stats
5765
run: |
5866
echo "sitemap-path = ${{ steps.sitemap.outputs.sitemap-path }}"
5967
echo "url-count = ${{ steps.sitemap.outputs.url-count }}"
6068
echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}"
6169
62-
- name: Linkcheck - Lychee
63-
uses: lycheeverse/lychee-action@v2
64-
with:
65-
args: -c .lychee.toml build/install/docs/mfc/
66-
fail: false
67-
6870
- name: Publish Documentation
6971
if: github.repository == 'MFlowCode/MFC' && github.ref == 'refs/heads/master' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' )
7072
run: |
@@ -81,5 +83,11 @@ jobs:
8183
git -C ../www commit -m "Docs @ ${GITHUB_SHA::7}" || true
8284
git -C ../www push
8385
86+
- name: Linkcheck - Lychee
87+
uses: lycheeverse/lychee-action@v2
88+
with:
89+
args: -c .lychee.toml build/install/docs/mfc/
90+
fail: true
91+
8492
# DOC_PUSH_URL should be of the format:
8593
# --> https://<username>:<token>@github.com/<username>/<repository>

.github/workflows/homebrew-release.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,14 @@ jobs:
109109
110110
echo "Updating formula to v${VERSION}..."
111111
112-
# Update URL
113-
sed -i "s|url \"https://github.com/MFlowCode/MFC/archive/refs/tags/v[^\"]*\.tar\.gz\"|url \"https://github.com/MFlowCode/MFC/archive/refs/tags/v${VERSION}.tar.gz\"|" "$FORMULA"
112+
# Update URL (match any GitHub archive URL, not just MFlowCode/MFC,
113+
# in case the formula temporarily points at a fork during testing)
114+
sed -i "s|url \"https://github.com/[^\"]*/archive/[^\"]*\.tar\.gz\"|url \"https://github.com/MFlowCode/MFC/archive/refs/tags/v${VERSION}.tar.gz\"|" "$FORMULA"
114115
115116
# Update SHA256 (the one right after url, not bottle SHAs)
116117
# This uses awk to only update the first sha256 after the url line
117118
awk -v newsha="$SHA256" '
118-
/^ url "https:\/\/github.com\/MFlowCode\/MFC/ { found_url=1 }
119+
/^ url "https:\/\/github.com\// { found_url=1 }
119120
found_url && /^ sha256 "/ && !updated {
120121
sub(/sha256 "[^"]*"/, "sha256 \"" newsha "\"")
121122
updated=1
@@ -157,13 +158,16 @@ jobs:
157158
git config user.email "github-actions[bot]@users.noreply.github.com"
158159
159160
git add Formula/mfc.rb
160-
git commit -m "Update MFC to v${VERSION}"
161161
162-
echo "Pushing to homebrew-mfc..."
163-
git push origin main
164-
165-
echo "Successfully pushed formula update!"
166-
echo "The bottle.yml workflow in homebrew-mfc will now build bottles automatically."
162+
if git diff --cached --quiet; then
163+
echo "::notice::Formula already up to date for v${VERSION} — nothing to push."
164+
else
165+
git commit -m "Update MFC to v${VERSION}"
166+
echo "Pushing to homebrew-mfc..."
167+
git push origin main
168+
echo "Successfully pushed formula update!"
169+
echo "The bottle.yml workflow in homebrew-mfc will now build bottles automatically."
170+
fi
167171
168172
- name: Dry run summary
169173
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true' }}

.lychee.toml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,12 @@ accept = ["200", "429"]
1616

1717
verbose = "error"
1818

19-
# Exclude sitemap from link checking (it contains pre-publish production URLs)
20-
exclude_path = ["**/sitemap.txt"]
19+
# Exclude sitemap file from scanning (it contains pre-publish production URLs)
20+
exclude_path = ["sitemap\\.xml"]
21+
22+
# Exclude URLs that fail due to external issues (broken SSL, pre-deploy only, etc.)
23+
exclude = [
24+
"https://mflowcode\\.github\\.io/sitemap\\.xml", # Only exists after deployment
25+
"https://cpe\\.ext\\.hpe\\.com", # HPE Cray docs have broken SSL cert
26+
"https://sc22\\.supercomputing\\.org", # Returns 415 to automated requests
27+
]

CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,25 @@ if (MFC_DOCUMENTATION)
806806
GEN_DOCS(post_process "MFC: Post-Process")
807807
GEN_DOCS(documentation "MFC")
808808

809+
# Inject per-page last-updated dates into documentation markdown files.
810+
# Runs after auto-generated .md files exist, before Doxygen processes them.
811+
# Uses a stamp file so it only runs once per build.
812+
add_custom_command(
813+
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/inject-dates.stamp"
814+
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/examples.md"
815+
"${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/case_constraints.md"
816+
"${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/physics_constraints.md"
817+
"${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/cli-reference.md"
818+
"${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/parameters.md"
819+
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/docs/inject-dates.py"
820+
"${CMAKE_CURRENT_SOURCE_DIR}"
821+
COMMAND "${CMAKE_COMMAND}" -E touch "${CMAKE_CURRENT_BINARY_DIR}/inject-dates.stamp"
822+
COMMENT "Injecting page dates into documentation"
823+
VERBATIM
824+
)
825+
add_custom_target(inject_page_dates DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/inject-dates.stamp")
826+
add_dependencies(documentation_doxygen inject_page_dates)
827+
809828
# > Copy Resources (main landing page & assets)
810829
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/docs/res"
811830
DESTINATION "docs/mfc")
@@ -814,6 +833,7 @@ if (MFC_DOCUMENTATION)
814833
DESTINATION "docs/mfc")
815834

816835
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/docs/index.html"
836+
"${CMAKE_CURRENT_SOURCE_DIR}/docs/404.html"
817837
DESTINATION "docs/mfc")
818838
endif()
819839

0 commit comments

Comments
 (0)