Skip to content

.hdoc.toml fixed

.hdoc.toml fixed #35

Workflow file for this run

#name: totally-not-rabbitmq
name: notRabbit
# Triggers the workflow on push or pull request events but only for the main branch
on:
push:
branches: [ feature/doc ]
pull_request:
branches: [ feature/doc ]
workflow_dispatch:
# A simple workflow to build a C++ project and generate documentation with hdoc
jobs:
build:
env:
BUILD_TYPE: 'Debug'
BUILD_HDOC_DIR: '/tmp/build'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies, then configure and build project
run: |
sudo apt install build-essential cmake ninja-build
# cmake -GNinja -Bbuild -DCMAKE_EXPORT_COMPILE_COMMANDS=1
# ninja -C build # Optional, you don't need to build the project to use hdoc
- name: Get Conan
uses: turtlebrowser/get-conan@v1.2
- name: Create default profile
run: conan profile detect --force
# - name: Update profile
# run: conan profile update settings.compiler.libcxx=libstdc++11 default
- name: Install LLVM
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17 all
# - name: Install clang
# run: sudo apt-get install clang-17 lld-17 libclang-cpp17-dev
- name: Cache HDOC build
id: cache-hdoc
uses: actions/cache@v4
with:
path: ${{ env.BUILD_HDOC_DIR }}
key: ${{ runner.os }}-hdoc
- name: Build hdoc
if: steps.cache-hdoc.outputs.cache-hit != 'true'
run: |
mkdir -p ${{ env.BUILD_HDOC_DIR }}
cd ${{ env.BUILD_HDOC_DIR }}
git clone https://github.com/PeterTh/hdoc.git
cd hdoc
pip3 install meson
CC=clang-17 CXX=clang++-17 CPP=clang-cpp-17 meson build
sudo ninja -C build
- name: Copy hdoc binary
run: |
sudo cp ${{ env.BUILD_HDOC_DIR }}/hdoc/build/hdoc /hdoc
sudo chmod +x /hdoc
- name: Configure CMake
run: cmake -B build -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES="conan_provider.cmake" -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
# - name: Run hdoc to generate documentation and push it to docs.hdoc.io
# uses: hdoc/hdoc-github-action@v2
# with:
# compile-commands-path: build/compile_commands.json
# hdoc-api-key: ${{ secrets.HDOC_PROJECT_API_KEY }}
- name: Run hdoc to generate documentation
run: |
sudo chmod +x /hdoc
sudo /hdoc --verbose
- name: Upload documentation to custom server
run: |
cd hdoc-output
zip -r archive.zip *
curl -X POST \
-F filedata=@archive.zip \
-F name="TotalyNotRabbitMQ" \
-F version="1.0.0" \
-F description="This is TotalyNotRabbitMQ." \
${{env.DOCSURL}}