Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
run: .github/workflows/source/hasEOLwhiteSpace
- name: Check test input files
run: .github/workflows/source/check_inputs.py
- name: Check default analysis links
run: .github/workflows/source/check_analysis_file_type.py
- name: Doxygen
run: |
sudo apt update
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/source/check_analysis_file_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#! /usr/bin/env python3

import sys
from pathlib import Path

# Resolve paths from this script location so the check works from any cwd.
repo_root = Path(__file__).resolve().parents[3]
canonical = repo_root / "Examples" / "analysis_default_regression.py"
search_roots = [
repo_root / "Examples" / "Tests",
repo_root / "Examples" / "Physics_applications",
]


failed = False

# Only tests and physics applications are expected to link to the shared analysis file.
for search_root in search_roots:
for path in search_root.rglob("analysis_default_regression.py"):
path_relative = path.relative_to(repo_root)

if not path.is_symlink():
print(
f"{path_relative} must be a symlink and point to Examples/analysis_default_regression.py"
)
failed = True
continue

# Keep broken or unexpected links reportable instead of raising early.
target = path.resolve(strict=False)
if target != canonical:
print(f"{path_relative} links to {target}, expected {canonical}")
failed = True

if failed:
print("FAILED")
sys.exit(1)
Loading