Documentation #39
This file contains hidden or 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: Documentation | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| env: | |
| EM_VERSION: 3.1.73 | |
| jobs: | |
| build-docs: | |
| name: Build Documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "lts/*" | |
| # Setup OCaml via action | |
| - uses: ocaml/setup-ocaml@v3 | |
| with: | |
| ocaml-compiler: 5 | |
| opam-disable-sandboxing: true | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y doxygen graphviz python3 python3-pip | |
| sudo apt-get install -y \ | |
| bubblewrap m4 libgmp-dev pkg-config | |
| - name: Install required opam packages | |
| run: opam install -y ocamlfind zarith | |
| - name: Build Z3 natively for Python documentation | |
| run: | | |
| eval $(opam env) | |
| echo "CC: $CC" | |
| echo "CXX: $CXX" | |
| echo "OCAMLFIND: $(which ocamlfind)" | |
| echo "OCAMLC: $(which ocamlc)" | |
| echo "OCAMLOPT: $(which ocamlopt)" | |
| echo "OCAML_VERSION: $(ocamlc -version)" | |
| echo "OCAMLLIB: $OCAMLLIB" | |
| mkdir build-x64 | |
| python3 scripts/mk_make.py --python --ml --build=build-x64 | |
| cd build-x64 | |
| make -j$(nproc) | |
| - name: Generate Documentation (from doc directory) | |
| working-directory: doc | |
| run: | | |
| eval $(opam env) | |
| python3 mk_api_doc.py --mld --output-dir=api --z3py-package-path=../build-x64/python/z3 --build=../build-x64 | |
| Z3BUILD=build-x64 python3 mk_params_doc.py | |
| mkdir api/html/ml | |
| ocamldoc -html -d api/html/ml -sort -hide Z3 -I $( ocamlfind query zarith ) -I ../build-x64/api/ml ../build-x64/api/ml/z3enums.mli ../build-x64/api/ml/z3.mli | |
| - name: Setup emscripten | |
| uses: mymindstorm/setup-emsdk@v14 | |
| with: | |
| no-install: true | |
| version: ${{env.EM_VERSION}} | |
| actions-cache-folder: "emsdk-cache" | |
| - name: Install dependencies | |
| working-directory: src/api/js | |
| run: npm ci | |
| - name: Build TypeScript | |
| working-directory: src/api/js | |
| run: npm run build:ts | |
| - name: Build wasm | |
| working-directory: src/api/js | |
| run: | | |
| emsdk install ${EM_VERSION} | |
| emsdk activate ${EM_VERSION} | |
| source $(dirname $(which emsdk))/emsdk_env.sh | |
| which node | |
| which clang++ | |
| npm run build:wasm | |
| - name: Generate JS Documentation (from doc directory) | |
| working-directory: doc | |
| run: | | |
| eval $(opam env) | |
| python3 mk_api_doc.py --js --output-dir=api --mld --z3py-package-path=../build-x64/python/z3 --build=../build-x64 | |
| - name: Deploy to z3prover.github.io | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
| external_repository: Z3Prover/z3prover.github.io | |
| destination_dir: ./api | |
| publish_branch: master | |
| publish_dir: ./doc/api | |
| user_name: github-actions[bot] | |
| user_email: github-actions[bot]@users.noreply.github.com |