-
Notifications
You must be signed in to change notification settings - Fork 98
145 lines (129 loc) · 5.09 KB
/
Copy pathreleaseDoc.yml
File metadata and controls
145 lines (129 loc) · 5.09 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Build Documentation
on:
push:
branches: [ master ]
pull_request:
# create:
# tags:
# - v*
# Cancel a run that has been superseded by a newer push to the same branch. Runs on master are
# never cancelled so that the documentation deployment always completes.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
release-doc:
name: Build and release documentation
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# cmake/hal_cmake_tools.cmake derives the HAL version through 'git describe --tags',
# so the full history including tags is required
fetch-depth: 0
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: bash
run: echo "timestamp=$(date -u +'%Y-%m-%d-%H-%M-%S')" >> "$GITHUB_OUTPUT"
- name: ccache cache files
uses: actions/cache@v4
with:
path: ${{runner.workspace}}/.ccache
key: ${{ runner.OS }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
${{ runner.OS }}-ccache-
- name: Install Dependencies
run: ./install_dependencies.sh
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: |
mkdir -p build/doc
cd build
echo "==> Disk usage before clean"
df -h .
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/hostedtoolcache
echo "==> Disk usage after clean"
df -h .
export BUILD_TYPE=Debug
cp -v $GITHUB_WORKSPACE/documentation/index.html doc/
cp -v $GITHUB_WORKSPACE/documentation/hal_screenshot.* doc/
ls -l doc
$GITHUB_WORKSPACE/tools/genversion.py $GITHUB_WORKSPACE
cmake -G Ninja $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_ALL_PLUGINS=ON -DBUILD_TESTS=ON -DBUILD_COVERAGE=ON -DPL_GUI=ON -DBUILD_DOCUMENTATION=ON -DPACKAGE_DEB=OFF -DCMAKE_INSTALL_PREFIX=/usr/
env:
CCACHE_DIR: ${{runner.workspace}}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: 400M
HAL_BASE_PATH: ${{runner.workspace}}/hal/build
- name: Build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
cd build
ninja
env:
CCACHE_DIR: ${{runner.workspace}}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: 400M
HAL_BASE_PATH: ${{runner.workspace}}/hal/build
- name: Build Doxygen
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
cd build
export BUILD_TYPE=Debug
mkdir -p doc/doc
cmake --build . --target doc --config $BUILD_TYPE
cp -R documentation/cpp-doc/html/* doc/doc/
env:
CCACHE_DIR: ${{runner.workspace}}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: 400M
HAL_BASE_PATH: ${{runner.workspace}}/hal/build
- name: Build Sphinx
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
cd build
export BUILD_TYPE=Debug
mkdir -p doc/pydoc
cmake --build . --target pydoc --config $BUILD_TYPE
cp -R documentation/python-doc/html/* doc/pydoc/
env:
CCACHE_DIR: ${{runner.workspace}}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
CCACHE_MAXSIZE: 400M
HAL_BASE_PATH: ${{runner.workspace}}/hal/build
- name: Deploy Doc
if: github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
BRANCH: gh-pages
ACCESS_TOKEN: ${{ secrets.GH_PAGES_TOKEN}}
FOLDER: build/doc
GIT_CONFIG_NAME: 'github-actions[bot]'
GIT_CONFIG_EMAIL: 'github-actions[bot]@users.noreply.github.com'