-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
96 lines (85 loc) · 3.3 KB
/
action.yml
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: 'Generate and Commit Docs'
inputs:
source-path:
description: 'Source path containing the .h files'
required: true
target-path:
description: 'Target path or file for the markdown documentation'
required: true
exclude-pattern:
description: 'Pattern for excluding files (e.g. "*/test/*")'
include-cpp:
description: 'Include .cpp files'
default: 'false'
access-level:
description: 'The minimum access level to be considered in the documentation'
default: 'public'
show-access-modifiers:
description: 'Show access modifiers in the documentation'
default: 'false'
fail-on-warnings:
description: 'Fail when documentation warnings are issued.'
default: 'false'
commit:
description: 'Boolean flag to indicate whether to commit changes'
default: 'true'
commit-message:
description: 'Commit message'
default: 'Update documentation'
committer-name:
description: 'Username to use as author of the commit.'
default: 'github-actions[bot]'
committer-email:
description: 'Email address to use as author of the commit.'
default: '41898282+github-actions[bot]@users.noreply.github.com'
debug:
description: 'Enable debugging mode to provide additional output'
default: 'false'
runs:
using: "composite"
steps:
- name: Install doxygen dependencies
shell: bash
run: |
# Import LLVM GPG key without using apt-key
wget -q -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg
# Add the LLVM repository with the GPG keyring
echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" | sudo tee /etc/apt/sources.list.d/llvm.list > /dev/null
# Update the package lists
sudo apt-get -qq update
# Install libclang and other necessary packages
sudo apt-get install -y libclang1-15 libclang-cpp15
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install render-docs
shell: bash
run: npm install github:arduino/render-docs#v1.0.0 --no-save
- name: Cache Doxygen binaries
id: cache-doxygen-binaries
uses: actions/cache@v4
with:
path: |
node_modules/doxygen/dist
key: ${{ runner.os }}-doxygen-binaries-${{ hashFiles('node_modules/doxygen/lib/constants.js') }}
- name: Run Docs Generation
shell: bash
run: |
npx render-docs \
${{ inputs.source-path }} \
${{ inputs.target-path }} \
${{ inputs.exclude-pattern && format('--exclude "{0}"', inputs.exclude-pattern) || '' }} \
${{ inputs.include-cpp == 'true' && '--include-cpp' || '' }} \
${{ inputs.show-access-modifiers == 'true' && '--show-access-modifiers' || '' }} \
${{ inputs.access-level && format('--access-level {0}', inputs.access-level) || '' }} \
${{ inputs.fail-on-warnings == 'true' && '--fail-on-warnings' || '' }} \
${{ inputs.debug == 'true' && '--debug ' || '' }}
- name: Commit Docs
if: inputs.commit
uses: EndBug/add-and-commit@v9
with:
add: "${{ inputs.target-path }}"
author_name: "${{ inputs.committer-name }}"
author_email: "${{ inputs.committer-email }}"
message: "${{ inputs.commit-message }}"