Skip to content

Commit

Permalink
feat: barretenberg doxygen CI (#3818)
Browse files Browse the repository at this point in the history
First pass on doxygen CI. This is now uploading files to S3 based on
running doxygen on the barretenberg codebase.

- It's mostly a listing of everything's signature + source, and a few
pieces of documentation. We can figure out a documentation plan from
here
- This needs to actually be pointed somewhere to be
[slash]meaningful[/slash] convenient right now, but lives here
https://aztec-ci-artifacts.s3.us-east-2.amazonaws.com/barretenberg-doxygen/3f0fad0de81d472cf71c03df11cf01ed6e7e09e0/index.html

---------

Co-authored-by: ludamad <adam@aztecprotocol.com>
Co-authored-by: Maddiaa <47148561+Maddiaa0@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 4, 2024
1 parent b53bacf commit 022a918
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,21 @@ jobs:
name: "Build"
command: cond_spot_run_build barretenberg-x86_64-linux-clang-sol 32

barretenberg-docs:
machine:
image: ubuntu-2204:2023.07.2
resource_class: large
steps:
- *checkout
- *setup_env
- run:
name: "Build barretenberg docs"
command: build barretenberg-docs
- run:
name: "Deploy barretenberg docs"
command: |
barretenberg/cpp/docs/deploy_doxygen.sh
barretenberg-stdlib-tests:
docker:
- image: aztecprotocol/alpine-build-image
Expand Down Expand Up @@ -1091,6 +1106,7 @@ workflows:
- barretenberg-x86_64-linux-clang-assert
- noir-compile-acir-tests
<<: *defaults
- barretenberg-docs: *defaults
- bb-js:
requires:
- barretenberg-wasm-linux-clang
Expand Down
5 changes: 4 additions & 1 deletion barretenberg/cpp/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@
!scripts/install-wasi-sdk.sh
!scripts/strip-wasm.sh
!./.clang-format
!./format.sh
!./format.sh

# Doxygen stuff.
!docs
8 changes: 8 additions & 0 deletions barretenberg/cpp/docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM alpine:3.18 AS builder
RUN apk update \
&& apk upgrade \
&& apk add --no-cache \
doxygen
WORKDIR /usr/src/barretenberg/cpp/
COPY . .
RUN doxygen docs/Doxyfile
19 changes: 19 additions & 0 deletions barretenberg/cpp/docs/Doxyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Minimal Doxyfile. See https://www.doxygen.nl/manual/config.html

# Project related configuration options
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "barretenberg"

# Paths and filenames
INPUT = src/barretenberg
HTML_OUTPUT = docs/build
FILE_PATTERNS = *.c \
*.cpp \
*.h \
*.hpp
RECURSIVE = YES

# Output format options
GENERATE_HTML = YES
GENERATE_LATEX = NO
HAVE_DOT = NO
14 changes: 14 additions & 0 deletions barretenberg/cpp/docs/deploy_doxygen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Uploads to S3 the contents of a doxygen barretenberg C++ documentation build.
# This is then to be used as a static website.
#!/usr/bin/env bash
[ -n "${BUILD_SYSTEM_DEBUG:-}" ] && set -x # conditionally trace
set -eu

extract_repo barretenberg-docs /usr/src extracted-repo

BUCKET_NAME="aztec-ci-artifacts"
COMMIT_HASH="${COMMIT_HASH:-$(git rev-parse HEAD)}"
TARGET_FOLDER="barretenberg-doxygen/$COMMIT_HASH"

echo "Uploading to s3://$BUCKET_NAME/$TARGET_FOLDER"
aws s3 cp extracted-repo/src/barretenberg/cpp/docs/build "s3://$BUCKET_NAME/$TARGET_FOLDER" --recursive
4 changes: 4 additions & 0 deletions build_manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ barretenberg-acir-tests-bb.js:
- bb.js
- noir-compile-acir-tests

barretenberg-docs:
buildDir: barretenberg/cpp
dockerfile: docs/Dockerfile

l1-contracts:
buildDir: l1-contracts

Expand Down

0 comments on commit 022a918

Please sign in to comment.