From b6467f101db6ef1a18b3a591d3322d2475c278a2 Mon Sep 17 00:00:00 2001 From: paugier Date: Thu, 4 Jan 2024 15:05:32 +0100 Subject: [PATCH] Build doc in CI --- .github/workflows/ci-linux.yml | 1 + .gitlab-ci.yml | 31 +++++++++++++++++++++++++++++++ .readthedocs.req | 1 - .readthedocs.yml | 23 ++++++++--------------- 4 files changed, 40 insertions(+), 16 deletions(-) delete mode 100644 .readthedocs.req diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 10e38ae68..354747a25 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -28,6 +28,7 @@ jobs: pip install pdm nox - name: Test with nox run: | + hg version -v cp .github/workflows/.fluidfft-site.cfg $HOME nox -s test_without_fft_and_pythran nox -s test_with_fft_and_pythran diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4a03a7ca0..72c0fb41d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ stages: - lint - test - report + - doc variables: COVERAGE_DIR: .coverage_$CI_COMMIT_SHA @@ -107,3 +108,33 @@ report_coverage: - pip install coverage - coverage combine - coverage report + + +doc:build: + stage: doc + needs: + - job: "CI image" + optional: true + variables: + FLUIDFFT_TRANSONIC_BACKEND: "python" + script: + - python -m venv .venv + - . .venv/bin/activate + - pip install fluidfft + - pdm install -G doc -G fft --no-self + - pip install . --config-settings=setup-args=-Dtransonic-backend=python + - pdm run xvfb-run --auto-servernum sphinx-build -W -b html -d doc/_build/doctrees doc doc/_build/html + - mkdir -p public/$CI_COMMIT_REF_NAME + - rsync -rvc --delete doc/_build/html/* public/$CI_COMMIT_REF_NAME/ + # This directory can become too large leading to error. + # It can be purged with the botton "Clear runner caches" + # in https://foss.heptapod.net/fluiddyn/fluidsim/-/pipelines + - ls public + - echo "CI_COMMIT_REF_NAME="$CI_COMMIT_REF_NAME + - echo See https://fluiddyn.pages.heptapod.net/fluidsim/$CI_COMMIT_REF_NAME + artifacts: + name: "$CI_COMMIT_REF_NAME" + paths: + - public + expire_in: 5 days + when: always diff --git a/.readthedocs.req b/.readthedocs.req deleted file mode 100644 index e83fc10f4..000000000 --- a/.readthedocs.req +++ /dev/null @@ -1 +0,0 @@ -./lib \ No newline at end of file diff --git a/.readthedocs.yml b/.readthedocs.yml index 5a643b7c0..050a31baa 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,24 +1,17 @@ -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -# Required version: 2 -# Set the version of Python and other tools you might need build: os: ubuntu-22.04 tools: python: "3.11" + jobs: + post_create_environment: + - pip install pdm pip -U + post_install: + - pdm use -f $READTHEDOCS_VIRTUALENV_PATH + - FLUIDFFT_TRANSONIC_BACKEND="python" pip install fluidfft + - pdm install -G doc -G fft --no-self + - pip install . --config-settings=setup-args=-Dtransonic-backend=python -# Build documentation in the doc directory with Sphinx sphinx: configuration: doc/conf.py - -python: - install: - - requirements: .readthedocs.req - - method: pip - path: . - extra_requirements: - - doc - - fft