forked from obspy/obspy
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (84 loc) · 3.28 KB
/
docs_building.yml
File metadata and controls
96 lines (84 loc) · 3.28 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
name: "docs"
on:
pull_request:
types: [opened, synchronize, reopened, labeled]
push:
branches:
- master
tags-ignore:
- '**'
release:
types: [published]
# cancel previous runs, but only in PRs, do not cancel previous runs if this run will be skipped
concurrency:
group: docs-${{ github.event.pull_request.number || github.run_id }}-${{ !((github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'build_docs')) || github.event.label.name == 'build_docs') || github.run_id }}
cancel-in-progress: true
jobs:
build:
# only run if on master branch OR if PR is updated and build_docs label present OR if build_docs_label is added
if: github.event_name != 'pull_request' || ((github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'build_docs')) || github.event.label.name == 'build_docs')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: setup conda
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: 'latest'
python-version: '3.11'
activate-environment: obspydoc
environment-file: .github/docs_conda_env.yml
- name: install obspy
shell: bash -l {0}
run: |
python -m pip install .
- name: print package info
shell: bash -l {0}
run: |
conda info -a
conda list
- name: build doc
shell: bash -l {0}
run: |
cd misc/docs
make html SPHINXOPTS="-j auto -w /tmp/sphinx_warnings.txt" 2>&1 | tee /tmp/sphinx_build.log
# Summarize
echo "=== WARNING count ===" && grep -c "WARNING" /tmp/sphinx_warnings.txt || true
echo "=== ERROR count ===" && grep -c "ERROR" /tmp/sphinx_warnings.txt || true
# IN THE FUTURE we should Fail the job if any ERRORs exist, but not now, otherwise the
# docs deployment code will never see it (deploy_docs.py checks for /success state).
# ! grep -q "ERROR" /tmp/sphinx_warnings.txt
# - name: upload sphinx diagnostics (not now, the deploy_doc expects only 2 artifacts)
# if: always() # upload even if previous step failed
# uses: actions/upload-artifact@v4
# with:
# name: sphinx-diagnostics
# path: /tmp/sphinx_warnings.txt
- name: compress with tar
if: always() # compress even if previous step failed
shell: bash -l {0}
run: |
cd misc/docs/build/html/
tar cfJ obspydoc.tar.xz *
- uses: actions/upload-artifact@v7
if: always() # upload even if previous step failed
with:
name: obspydoc
path: misc/docs/build/html/obspydoc.tar.xz
- name: build docset
if: always() # build even if previous step failed
shell: bash -l {0}
run: |
cd misc/docs
bash make_docset.sh
- name: actions/upload-artifact@v4 for docset
if: always() # upload even if previous step failed
uses: actions/upload-artifact@v4
with:
name: obspydocset
path: misc/docs/build/obspy-*.docset.tgz
- name: Report Warnings
if: always()
run: |
cat /tmp/sphinx_warnings.txt