Skip to content

Commit fb73b3e

Browse files
authored
CI: Build docs on PR if src/ or docs/ change + index.md typo fix (#8)
* Update plotting documentation and function comments - Enhanced documentation for plot_param_line and calculate_param_line functions - Updated module documentation in Linear_Algebra.jl - Improved function docstrings for clarity and consistency - Updated docs/src/index.md with plotting-related documentation * fix: correct @autodocs Pages syntax error in documentation - Fixed malformed quotes in @autodocs Pages parameter - Changed Pages = [""linear_algebra_transform.jl"] to Pages = ["linear_algebra_transform.jl"] - Documentation now builds successfully without parse errors * ci: build docs on PR only if src/ or docs/ change - Adds docs-build job for PRs - Uses shell check to detect changes in src/ or docs/ and skips build otherwise - Prevents docs build for unrelated file changes (e.g., copilot-instructions.md)
1 parent e07e6ec commit fb73b3e

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

.github/workflows/CI.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,41 @@ jobs:
4040
run: >
4141
julia --project=. --color=yes test/runtests.jl
4242
43+
docs-build:
44+
name: Build Documentation
45+
if: github.event_name == 'pull_request'
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v4
49+
with:
50+
fetch-depth: 0
51+
- name: Check for docs/src changes
52+
id: docs-changes
53+
run: |
54+
git fetch origin ${{ github.base_ref }}
55+
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD)
56+
echo "Changed files: $CHANGED_FILES"
57+
if echo "$CHANGED_FILES" | grep -qE '^(src/|docs/)'; then
58+
echo "docs_changed=true" >> $GITHUB_OUTPUT
59+
else
60+
echo "docs_changed=false" >> $GITHUB_OUTPUT
61+
fi
62+
- uses: julia-actions/setup-julia@v1
63+
if: steps.docs-changes.outputs.docs_changed == 'true'
64+
with:
65+
version: '1'
66+
arch: x64
67+
- uses: julia-actions/cache@v1
68+
if: steps.docs-changes.outputs.docs_changed == 'true'
69+
- uses: julia-actions/julia-buildpkg@v1
70+
if: steps.docs-changes.outputs.docs_changed == 'true'
71+
- name: Build documentation
72+
if: steps.docs-changes.outputs.docs_changed == 'true'
73+
run: julia --project=. --color=yes docs/make.jl
74+
- name: Skip docs build (no relevant changes)
75+
if: steps.docs-changes.outputs.docs_changed == 'false'
76+
run: echo "No docs or src changes detected, skipping docs build."
77+
4378
deploy-docs:
4479
name: Deploy Documentation
4580
# Only run deployment on pushes to main (after merge) or manual trigger

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ This section provides the documentation for linear transformations and related o
1919
```@autodocs
2020
Modules = [Linear_Algebra]
2121
Order = [:function, :type]
22-
Pages = [""linear_algebra_transform.jl"]
22+
Pages = ["linear_algebra_transform.jl"]
2323
```

0 commit comments

Comments
 (0)