Skip to content

Ignore clang's compile commands symlink #201

Ignore clang's compile commands symlink

Ignore clang's compile commands symlink #201

Workflow file for this run

name: Documentation
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
docs:
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: ./.github/actions/setup-cmake
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
libgl1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev \
libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev pngquant
- name: Compile docsparser
run: gcc tools/docs_parser.c -Ilibraries -o docsparser
- name: Generate documentation
run: ./docsparser
- name: Setup CCache (native)
uses: hendrikmuhs/ccache-action@v1.2
with:
key: docs-native
- name: Configure native build
run: |
cmake -S . -B build-native -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCF_FRAMEWORK_BUILD_SAMPLES=OFF \
-DCF_FRAMEWORK_BUILD_TESTS=OFF \
-DCF_RUNTIME_SHADER_COMPILATION=OFF \
-DCF_CUTE_SHADERC=ON \
-DCF_BUILD_DOCSPARSER=OFF \
-DSDL_AUDIO=OFF \
-DSDL_CAMERA=OFF \
-DSDL_DBUS=OFF \
-DSDL_DIALOG=OFF \
-DSDL_DIRECTX=OFF \
-DSDL_HAPTIC=OFF \
-DSDL_HIDAPI=OFF \
-DSDL_JOYSTICK=OFF \
-DSDL_KMSDRM=OFF \
-DSDL_METAL=OFF \
-DSDL_OFFSCREEN=OFF \
-DSDL_OPENGL=OFF \
-DSDL_OPENGLES=OFF \
-DSDL_POWER=OFF \
-DSDL_RENDER=OFF \
-DSDL_SENSOR=OFF \
-DSDL_TESTS=OFF \
-DSDL_UNIX_CONSOLE_BUILD=ON \
-DSDL_VULKAN=OFF \
-DSDL_WAYLAND=OFF \
-DSDL_X11=OFF
- name: Build cute-shaderc
run: cmake --build build-native --target cute-shaderc
- name: Generate precompiled shader headers
run: |
echo "Compiling builtin shaders..."
build-native/cute-shaderc \
-type=builtin \
-oheader=src/data/builtin_shaders_bytecode.h
find samples -name "*.shd" | while read shd_file; do
dir=$(dirname "$shd_file")
base=$(basename "$shd_file" .shd)
echo "Compiling shader: $shd_file -> ${dir}/${base}_shd.h"
build-native/cute-shaderc \
-type=draw \
-varname="s_${base}_shd_bytecode" \
-oheader="${dir}/${base}_shd.h" \
"$shd_file"
done
- name: Set up Emscripten
uses: mymindstorm/setup-emsdk@v14
with:
version: latest
actions-cache-folder: "emsdk-cache"
- name: Setup CCache (emscripten)
uses: hendrikmuhs/ccache-action@v1.2
with:
key: docs-emscripten
- name: Pre-build Emscripten ports
run: |
mkdir -p "$(em-config CACHE)/sysroot/lib/pkgconfig"
embuilder build sdl3
- name: Configure Emscripten build
run: |
emcmake cmake -S . -B build-emscripten -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_SCAN_FOR_MODULES=OFF \
-DCF_FRAMEWORK_BUILD_SAMPLES=ON \
-DCF_FRAMEWORK_BUILD_TESTS=OFF \
-DCF_BUILD_DOCSPARSER=OFF
- name: Build Emscripten samples
run: cmake --build build-emscripten
- name: Generate sample pages
run: |
ruby ./tools/generate_sample_pages.rb build-emscripten docs https://github.com/RandyGaul/cute_framework
- name: Set up Python runtime
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install Python dependencies
run: pip install mkdocs mkdocs-material "mkdocs-material[imaging]" markdown-callouts
- name: Build documentation
run: |
mkdocs build --clean
mkdocs --version
- name: Adjust permissions
run: |
chmod -c -R +rX site/ | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload to GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: site
deploy:
name: Deploy documentation
needs: docs
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4