From 801b1f2371a0d70cb2a917112eb435f9f8a7efb4 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Tue, 20 Apr 2021 10:59:52 +0200 Subject: [PATCH] ci: Update and embed docs in one step using `generator.py` `generator.py` can now be used to perform documentation generation and embedding in one go, simplifying the entire process while at the same time getting rid of intermediate `docs.md` being checked in to the repository. For this the CI needs the submodules with `gir` and the `.gir` files. --- .gitlab-ci.yml | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ff7f00b35..a3194e291 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -443,29 +443,33 @@ coverage: cobertura: coverage.xml docs: + variables: + GIT_SUBMODULE_STRATEGY: recursive extends: .img-nightly stage: 'extras' script: + - cargo install rustdoc-stripper + - PATH=~/.cargo/bin/:$PATH ./generator.py --embed-docs --no-fmt - | - for crate in gstreamer* gstreamer-gl/{egl,wayland,x11}; do - pushd $crate - RUSTDOCFLAGS="$RUST_DOCS_FLAGS" cargo +nightly doc --color=always --features=dox,embed-lgpl-docs --no-deps - popd - done - -pages: - extends: .img-nightly - stage: 'deploy' - - script: - - | - for crate in gstreamer* gstreamer-gl/{egl,wayland,x11}; do - cd $crate - RUSTDOCFLAGS="$RUST_DOCS_FLAGS" cargo +nightly doc --color=always --features=dox,embed-lgpl-docs --no-deps - cd .. - done + crate_names=$(for manifest in gstreamer*/Cargo.toml; do echo -n " -p ${manifest%%/Cargo.toml}"; done) + crate_names="$crate_names -p gstreamer-gl-egl -p gstreamer-gl-wayland -p gstreamer-gl-x11" + RUSTDOCFLAGS="$RUST_DOCS_FLAGS" cargo +nightly doc $crate_names --color=always --features=dox --no-deps - mv target/doc public/ - when: 'manual' + artifacts: + paths: + - 'public' + +# https://docs.gitlab.com/ee/user/project/pages/#how-it-works +# GitLab automatically deploys the `public/` folder from an +# artifact generated by the job named `pages`. This step +# re-uses the docs from the build-test `docs` step above. +pages: + stage: 'deploy' + when: 'manual' + dependencies: + - docs + script: + - ls public/ artifacts: paths: - 'public'