diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..0da4471 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,80 @@ +name: Documentation + +on: + push: + branches: [canon] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: pages + cancel-in-progress: true + +env: + LLVM_VERSION: "20" + +jobs: + build: + runs-on: ubuntu-24.04 + permissions: + contents: read + pages: read + + steps: + - uses: actions/checkout@v4 + + - name: Install LLVM ${{ env.LLVM_VERSION }}, MLIR, and Doxygen + run: | + wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc + sudo add-apt-repository -y "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-${LLVM_VERSION} main" + sudo apt-get update + sudo apt-get install -y \ + clang-${LLVM_VERSION} \ + clang-tidy-${LLVM_VERSION} \ + doxygen \ + llvm-${LLVM_VERSION}-dev \ + libmlir-${LLVM_VERSION}-dev \ + mlir-${LLVM_VERSION}-tools + + - uses: astral-sh/setup-uv@v4 + + - name: Install documentation dependencies + run: uv sync --group docs + + - name: Configure + run: | + cmake -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER=clang-${LLVM_VERSION} \ + -DCMAKE_CXX_COMPILER=clang++-${LLVM_VERSION} \ + -DMLIR_DIR=/usr/lib/llvm-${LLVM_VERSION}/lib/cmake/mlir \ + -DLLVM_DIR=/usr/lib/llvm-${LLVM_VERSION}/lib/cmake/llvm \ + -DWARPFORTH_ENABLE_DOCS=ON + + - name: Build documentation + run: cmake --build build --target docs-warpforth + + - name: Configure GitHub Pages + uses: actions/configure-pages@v5 + + - name: Upload GitHub Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: build/docs/html + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-24.04 + needs: build + permissions: + pages: write + id-token: write + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/README.md b/README.md index 0c97ed5..c783eff 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ An MLIR-based Forth compiler for programming GPU kernels. WarpForth defines a custom MLIR dialect for Forth stack operations and lowers through a pipeline of passes to PTX assembly. +See the [documentation](https://tetsuo-cpp.github.io/warpforth/). + ## Dependencies - LLVM/MLIR