L3-Rabbit merge #35
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: totally-not-rabbitmq | |
name: notRabbit | |
# Triggers the workflow on push or pull request events but only for the main branch | |
on: | |
push: | |
branches: [ dev ] | |
pull_request: | |
branches: [ dev ] | |
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/[email protected] | |
- 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: Restore Cache HDOC build | |
id: cache-hdoc-restore | |
uses: actions/cache/restore@v4 | |
with: | |
path: ${{ env.BUILD_HDOC_DIR }} | |
key: ${{ runner.os }}-hdoc | |
- name: Build hdoc | |
if: steps.cache-hdoc-restore.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: Save Cache HDOC build | |
id: cache-hdoc-save | |
uses: actions/cache/save@v4 | |
with: | |
path: ${{ env.BUILD_HDOC_DIR }} | |
key: ${{ steps.cache-hdoc-restore.outputs.cache-primary-key }} | |
- 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 | |
run: | | |
sudo chmod +x /hdoc | |
sudo /hdoc --verbose | |
- name: zip documentation | |
run: | | |
cd hdoc-output | |
sudo zip -r archive.zip * | |
cd .. | |
- name: Upload documentation to custom server | |
run: | | |
cd hdoc-output | |
sudo curl -X POST \ | |
-F [email protected] \ | |
-F name="TotalyNotRabbitMQDevBranch" \ | |
-F version="1.0.0" \ | |
-F description="This is TotalyNotRabbitMQ." \ | |
${{vars.DOCSURL}} |