-
Notifications
You must be signed in to change notification settings - Fork 3
113 lines (96 loc) · 3.41 KB
/
docs.yml
File metadata and controls
113 lines (96 loc) · 3.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Documentation
on:
push:
branches: ['**'] # Build on all branches
pull_request:
branches: ['**']
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-docs-${{ hashFiles('docs/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-docs-
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libhdf5-dev pkg-config
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
# Install pytables separately if needed by the package
pip install --verbose tables
pip install -r docs/requirements.txt
pip install -e .
- name: Lint documentation with doc8
run: doc8 README.rst docs CITATION.rst --max-line-length=100 --ignore-path docs/source/solarwindpy.solar_activity.tests.rst
- name: Check documentation links
run: |
pip install sphinx-link-checker
sphinx-build -b linkcheck docs docs/build/linkcheck
continue-on-error: true
- name: Build documentation
env:
SPHINXOPTS: -W --keep-going -n # Warnings as errors, but show all
working-directory: docs
run: |
make clean
make html
- name: Upload documentation artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: documentation-${{ github.run_id }}
path: |
docs/build/html/
docs/build/doctrees/
docs/build/coverage/
docs/build/linkcheck/
retention-days: 90
- name: Check documentation coverage
run: |
mkdir -p docs/build/coverage
python -m sphinx.ext.coverage -d docs/build/doctrees -o docs/build/coverage docs
# Generate a summary report
echo "Documentation Coverage Summary:" > docs/build/coverage/summary.txt
find docs/build/coverage -name "*.txt" -exec cat {} \; >> docs/build/coverage/summary.txt
continue-on-error: true
deploy:
needs: build
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libhdf5-dev pkg-config
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
# Install pytables separately if needed by the package
pip install --verbose tables
pip install -r docs/requirements.txt
pip install -e .
- name: Build documentation for deployment
working-directory: docs
run: |
make clean
make html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
cname: solarwindpy.github.io # If you have a custom domain