Repository navigation
74 lines (64 loc) · 2.48 KB
/
Copy pathdocs.yml
File metadata and controls
74 lines (64 loc) · 2.48 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
name: Docs -> GitHub Pages
on:
push:
branches: [master]
paths: &docs-paths
- 'src/ExcelReader.Core/**'
- 'src/ExcelReader.Arrow/**'
- 'src/ExcelReader.Native/include/**'
- 'python/src/**'
- 'python/scripts/api_markdown.py'
- 'cpp/scripts/api_markdown.py'
- 'docs/**'
- '**.md'
- 'docfx.json'
- 'assets/**'
- '.github/workflows/docs.yml'
# Builds without publishing, so a broken page or a Doxygen @param that no longer matches its
# signature fails the pull request instead of the next publish.
pull_request:
paths: *docs-paths
workflow_dispatch:
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-dotnet@v6
with:
global-json-file: global.json
# The snippets themselves are compiled by ci.yml, which builds the whole solution.
- name: Check guide examples match docs/snippets
run: python3 docs/snippets/sync.py --check
# Importing excelreader loads the native library lazily, so this needs only the sources.
- name: Build Python API reference
run: python3 python/scripts/api_markdown.py
# Fails on any Doxygen documentation warning, such as an @param naming no parameter.
- name: Build C++ API reference
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends doxygen
python3 cpp/scripts/api_markdown.py
# Fails on a broken page link or an xref naming a member that no longer exists. Core loads the
# generator as an analyzer from its bin/Release output, so it is built first, or docfx warns
# FailedToResolveAnalyzer.
- name: Build site
run: |
dotnet build src/ExcelReader.Generator/ExcelReader.Generator.csproj --configuration Release -p:RunAnalyzers=false
dotnet tool install --global docfx --version 2.81.0
docfx docfx.json --warningsAsErrors
# keep_files leaves dev/bench (benchmark-pages.yml) in place; pages removed from the docs
# stay on the branch until deleted by hand.
- name: Publish to gh-pages
if: github.event_name != 'pull_request'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site
publish_branch: gh-pages
keep_files: true