Style the search results #365
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: clang-doc | |
on: | |
push: | |
branches: [main] | |
jobs: | |
docs: | |
name: Generate documentation with clang-doc | |
# Is disabled. | |
if: false && (github.repository == 'chromium/subspace') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- uses: webfactory/ssh-agent@v0.7.0 | |
with: | |
ssh-private-key: ${{ secrets.DOCS_SSH_PRIVATE_KEY }} | |
- name: Install LLVM+Clang | |
run: | | |
wget https://apt.llvm.org/llvm.sh | |
chmod +x llvm.sh | |
sudo ./llvm.sh 16 all | |
- name: Configure | |
run: | | |
# Path to LLVM+Clang nightly that we have installed. | |
export LLVM_DIR="/usr/lib/llvm-16/lib/cmake/llvm" | |
export Clang_DIR="/usr/lib/llvm-16/lib/cmake/clang" | |
sudo apt install build-essential cmake ninja-build | |
cmake -G Ninja -B out -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DSUBSPACE_BUILD_SUBDOC=OFF | |
- name: Checkout docs | |
run: | | |
git clone git@github.com:danakj/subspace-docs.git docs | |
- name: Generate | |
run: | | |
# Work around https://github.com/llvm/llvm-project/issues/59815 as the | |
# default stylesheet and index.js are not included in the debian | |
# package, which leads to an error when running the tool. | |
sudo mkdir -p /usr/lib/llvm-16/share/clang/ | |
sudo cp tools/clang-doc/clang-doc-default-stylesheet.css /usr/lib/llvm-16/share/clang/ | |
sudo cp tools/clang-doc/index.js /usr/lib/llvm-16/share/clang/ | |
# For crash dumps. | |
export LLVM_SYMBOLIZER_PATH="/usr/lib/llvm-16/bin/llvm-symbolizer" | |
clang-doc-16 \ | |
--executor=all-TUs \ | |
--format=html \ | |
--public \ | |
--extra-arg=-Wno-error \ | |
--project-name=Subspace \ | |
--repository=https://github.com/chromium/subspace/blob/main \ | |
--output=docs \ | |
-p out compile_commands.json | |
- name: Deploy | |
run: | | |
SHA=`git rev-parse HEAD` | |
cd docs | |
git config user.email "noreply@chromium.org" | |
git config user.name "Subspace clang-doc generator" | |
git add . | |
git commit -m "Update docs: $SHA" | |
git push origin | |