Added a dummy Kyber implementation and test scaffolding #278
Workflow file for this run
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: Deploy static content to GitHub Pages | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
# Single deploy job since we're just deploying | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# sphinx-multiversion uses tags to build | |
# the documentation in multiple versions. | |
- name: Checkout | Fetch tags | |
run: git fetch --tags origin | |
- name: Setup | mdBook | 1/2 | |
uses: hecrj/setup-rust-action@8708beccd22540a3f955ae10cc884af27ca81bf5 | |
- name: Setup | mdBook | 2/2 | |
uses: peaceiris/actions-mdbook@4b5ef36b314c2599664ca107bb8c02412548d79d | |
with: | |
mdbook-version: "latest" | |
- name: Setup | Update | |
run: sudo apt-get update | |
- name: Setup | System | |
run: | | |
sudo apt-get install doxygen python3-sphinx libgmp-dev ninja-build nodejs | |
sudo pip install --upgrade pip | |
- name: Setup | OCaml | 1/2 | |
uses: ocaml/setup-ocaml@v2 | |
with: | |
ocaml-compiler: 4.14.1 | |
- name: Setup | OCaml | 2/2 | |
run: | | |
opam install --yes ocamlfind odoc ctypes zarith cppo dune | |
- name: Setup | JS | |
run: | | |
npm install -g jsdoc | |
- name: Setup | Sphinx | |
run: | | |
cd docs/reference | |
pip install -r requirements.txt | |
- name: Setup | Pages | |
uses: actions/configure-pages@v2 | |
- name: Build | Book | |
run: | | |
# We `cd` into this directory first because the book | |
# uses references relative to this directory, i.e., | |
# `../../../rust/src/aead.rs`. | |
pushd docs/book | |
mdbook build | |
popd | |
mv docs/book/book build | |
- name: Build | C API Reference | |
run: | | |
mkdir build/c | |
sphinx-multiversion docs/reference build/c | |
- name: Build | OCaml API Reference | |
run: | | |
mkdir -p build/ocaml/main | |
./opam.sh | |
cd opam | |
eval $(opam env) | |
opam install . --yes | |
dune build @doc --only-packages=hacl-star | |
cp -r _build/default/_doc/_html/* ../build/ocaml/main/ | |
# TODO: #423 ctypes.stubs need to be added to old tags to build documentation. | |
# https://github.com/cryspen/hacl-packages/commit/81303b83a54a92d3b5f54f1b8ddbea60438cc2bf | |
# - name: Build | OCaml API Reference for Tags | |
# run: | | |
# mkdir -p build/ocaml | |
# for branch in $(git for-each-ref --format='%(refname)' refs/tags/); do | |
# if [[ "$branch" == *"ocaml-"* ]]; then | |
# rm -rf opam | |
# tag=$(echo $branch | cut -d'/' -f 3) | |
# git checkout $tag | |
# echo "Building documentation for $tag" | |
# mkdir -p build/ocaml/$tag | |
# ./opam.sh | |
# cd opam | |
# eval $(opam env) | |
# opam install . --yes | |
# dune build @doc --only-packages=hacl-star | |
# cp -r _build/default/_doc/_html/* ../build/ocaml/$tag/ | |
# cd ../ | |
# fi | |
# done | |
- name: Build | JS API Reference | |
run: | | |
git checkout main | |
cp -r js/* src/wasm | |
cd src/wasm | |
mkdir doc | |
node api_doc.js | |
jsdoc doc/readable_api.js -d doc/out | |
cd ../.. | |
mkdir -p build/js | |
cp -r src/wasm/doc/out build/js/main | |
- name: Build | Rust Docs | |
run: | | |
mkdir -p build/rust | |
cd rust/hacl-sys | |
cargo doc --no-deps | |
cp -r target/doc ../../build/rust/main | |
cd ../ | |
cargo doc --no-deps --all-features | |
cp -r target/doc/* ../build/rust/main | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: "build" | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |