diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index d41f3c106..1a679de7e 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -8,13 +8,6 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: - # Make this workflow depend on the other one. - workflow_run: - workflows: - - "GitHub CI" - types: - - success - # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read @@ -39,10 +32,8 @@ jobs: uses: actions/checkout@v4 - name: Setup Pages uses: actions/configure-pages@v4 - - name: Download artifact - uses: actions/download-artifact@v4 - with: - name: docs + - name: Build docs + run: bash tools/gha_conda_docs.sh - name: Upload docs uses: actions/upload-pages-artifact@v3 with: diff --git a/tools/gha_conda_docs.sh b/tools/gha_conda_docs.sh new file mode 100644 index 000000000..8916b6d3a --- /dev/null +++ b/tools/gha_conda_docs.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +# Echo each command +set -x + +# Exit on error. +set -e + +# Core deps. +sudo apt-get install wget + +# Install conda+deps. +wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -O miniconda.sh +export deps_dir=$HOME/local +export PATH="$HOME/miniconda/bin:$PATH" +bash miniconda.sh -b -p $HOME/miniconda +conda create -y -p $deps_dir c-compiler cxx-compiler cmake \ + llvmdev tbb-devel tbb libboost-devel mppp sleef xtensor \ + xtensor-blas blas blas-devel fmt spdlog ninja \ + 'sphinxcontrib-bibtex=2.6.*' 'sphinx=7.*' 'sphinx-book-theme=1.*' +source activate $deps_dir + +# Create the build dir and cd into it. +mkdir build +cd build + +# Clear the compilation flags set up by conda. +unset CXXFLAGS +unset CFLAGS + +# Configure. +cmake ../ -G Ninja \ + -DCMAKE_PREFIX_PATH=$deps_dir \ + -DCMAKE_BUILD_TYPE=Debug \ + -DHEYOKA_BUILD_TESTS=yes \ + -DHEYOKA_BUILD_TUTORIALS=ON \ + -DHEYOKA_WITH_MPPP=yes \ + -DHEYOKA_WITH_SLEEF=yes \ + -DCMAKE_CXX_FLAGS_DEBUG="-g -Og" + +# Build. +ninja -v -j4 + +# Run the tests. +ctest -VV -j4 + +# Build the docs. +cd ../doc +export SPHINX_OUTPUT=`make html linkcheck 2>&1 >/dev/null`; +if [[ "${SPHINX_OUTPUT}" != "" ]]; then + echo "Sphinx encountered some problem:"; + echo "${SPHINX_OUTPUT}"; + exit 1; +fi +echo "Sphinx ran successfully"; + +set +e +set +x