Repository navigation
113 lines (106 loc) · 4.41 KB
/
Copy pathxml-docs.yml
File metadata and controls
113 lines (106 loc) · 4.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: Check XML documentation
on:
push:
branches: [main]
pull_request:
branches: [main]
merge_group:
types: [checks_requested]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.sha || github.ref }}
# Superseded pull request runs are cancelled. Every main commit runs, and
# the job that publishes the C++ documentation shares the gh-pages queue.
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
GIT_CONFIG_COUNT: '1'
GIT_CONFIG_KEY_0: init.defaultBranch
GIT_CONFIG_VALUE_0: main
DOXYGEN_VERSION: 1.18.0
DOXYGEN_SHA256: 14fa81bdc34171edb5f1f02b1d60e74802f0439b77fa44e592565d517d72df90
jobs:
plan:
runs-on: ubuntu-24.04
timeout-minutes: 5
outputs:
xmlDocs: ${{ steps.select.outputs.xmlDocs }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
persist-credentials: false
- uses: ./.github/actions/ci-plan
id: select
check:
needs: plan
if: ${{ needs.plan.outputs.xmlDocs == 'true' }}
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '24'
- name: Test the XML documentation check and the C++ documentation scripts
run: node --test .github/scripts/check-xml-docs.test.mjs .github/scripts/doxygen-para-filter.test.mjs .github/scripts/validate-cpp-docs.test.mjs .github/scripts/publish-docs.test.mjs
- name: Check that every XML documentation comment is complete and bilingual
run: node .github/scripts/check-xml-docs.mjs
- name: Install the pinned Doxygen release
run: |
archive="doxygen-$DOXYGEN_VERSION.linux.bin.tar.gz"
curl --fail --silent --show-error --location --retry 3 --output "$RUNNER_TEMP/$archive" \
"https://github.com/doxygen/doxygen/releases/download/Release_${DOXYGEN_VERSION//./_}/$archive"
echo "$DOXYGEN_SHA256 $RUNNER_TEMP/$archive" | sha256sum --check --strict
tar --extract --gzip --file "$RUNNER_TEMP/$archive" --directory "$RUNNER_TEMP"
echo "DOXYGEN=$RUNNER_TEMP/doxygen-$DOXYGEN_VERSION/bin/doxygen" >> "$GITHUB_ENV"
- name: Check that every public and protected C# and C++ element is documented
run: .github/scripts/check-doxygen-coverage.sh
- name: Build the C++ API documentation
run: .github/scripts/build-cpp-docs.sh _site-cpp
- name: Validate the C++ API documentation
run: .github/scripts/validate-cpp-docs.sh _site-cpp
- name: Upload the C++ API documentation
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: cpp-documentation
path: _site-cpp
if-no-files-found: error
retention-days: 1
deployCppDocumentation:
needs: [plan, check]
if: ${{ github.event_name == 'push' && needs.plan.outputs.xmlDocs == 'true' }}
runs-on: ubuntu-24.04
timeout-minutes: 10
concurrency:
group: gh-pages
queue: max
permissions:
actions: read
contents: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
persist-credentials: false
- name: Check whether a newer main commit will generate documentation
id: publication
env:
BASE_SHA: ${{ github.sha }}
run: GITHUB_SHA=refs/remotes/origin/main node .github/scripts/plan-ci.mjs
- name: Download the verified C++ API documentation
if: ${{ steps.publication.outputs.xmlDocs == 'false' }}
env:
GH_TOKEN: ${{ github.token }}
run: gh run download "$GITHUB_RUN_ID" --repo "$GITHUB_REPOSITORY" --name cpp-documentation --dir _site-cpp
- name: Validate the downloaded C++ API documentation
if: ${{ steps.publication.outputs.xmlDocs == 'false' }}
run: .github/scripts/validate-cpp-docs.sh _site-cpp
- name: Publish the C++ API documentation to gh-pages
if: ${{ steps.publication.outputs.xmlDocs == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: .github/scripts/publish-docs.sh _site-cpp cpp