Unverified Commit 63a4d8b4 authored by Denis_P's avatar Denis_P 🏑 Committed by GitHub
Browse files

CI: rustdoc (#3613)

* CI: build rustdocs

* CI: publish rustdocs

* CI: naming

* CI: debug

* CI: MVP

* CI: copypasta

* CI: start page

* CI: better start page

* Revert "CI: debug"

This reverts commit 497051f4.
parent a8ae70a9
Pipeline #152353 failed with stages
in 36 minutes and 11 seconds
......@@ -41,9 +41,15 @@ default:
- ./artifacts/
.kubernetes-env: &kubernetes-env
retry:
max: 2
when:
- runner_system_failure
- unknown_failure
- api_failure
interruptible: true
tags:
- kubernetes-parity-build
interruptible: true
.docker-env: &docker-env
retry:
......@@ -232,6 +238,28 @@ generate-impl-guide:
script:
- mdbook build roadmap/implementers-guide
build-rustdoc:
stage: build
<<: *docker-env
<<: *rules-test
variables:
SKIP_WASM_BUILD: 1
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc"
when: on_success
expire_in: 7 days
paths:
- ./crate-docs/
script:
# FIXME: it fails with `RUSTDOCFLAGS="-Dwarnings"` and `--all-features`
- time cargo doc --no-deps --workspace --verbose
- rm -f ./target/doc/.lock
- mv ./target/doc ./crate-docs
# FIXME: remove me after CI image gets nonroot
- chown -R nonroot:nonroot ./crate-docs
- echo "<meta http-equiv=refresh content=0;url=polkadot_service/index.html>" > ./crate-docs/index.html
- sccache -s
.build-push-image: &build-push-image
<<: *kubernetes-env
image: quay.io/buildah/stable
......@@ -393,6 +421,43 @@ publish-s3-release: &publish-s3
- aws s3 ls s3://${AWS_BUCKET}/${PREFIX}/${EXTRATAG}/
--recursive --human-readable --summarize
publish-rustdoc:
stage: publish
<<: *kubernetes-env
image: paritytech/tools:latest
variables:
GIT_DEPTH: 100
rules:
- if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME == "master"
script:
- rm -rf /tmp/*
# Set git config
- rm -rf .git/config
- git config user.email "devops-team@parity.io"
- git config user.name "${GITHUB_USER}"
- git config remote.origin.url "https://${GITHUB_TOKEN}@github.com/paritytech/polkadot.git"
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- git fetch origin gh-pages
# Save README and docs
- cp -r ./crate-docs/ /tmp/doc/
- cp README.md /tmp/doc/
- git checkout gh-pages
# Remove everything and restore generated docs and README
- rm -rf ./*
- mv /tmp/doc/* .
# Upload files
- git add --all --force
# `git commit` has an exit code of > 0 if there is nothing to commit.
# This causes GitLab to exit immediately and marks this job failed.
# We don't want to mark the entire job failed if there's nothing to
# publish though, hence the `|| true`.
- git commit -m "Updated docs for ${CI_COMMIT_REF_NAME}" ||
echo "___Nothing to commit___"
- git push origin gh-pages --force
after_script:
- rm -rf .git/ ./*
#### stage: deploy
deploy-polkasync-kusama:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment