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.
This commit is contained in:
Marijn Suijten 2021-04-20 10:59:52 +02:00
parent 9dec3c359f
commit 801b1f2371

View file

@ -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'