mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 11:31:05 +00:00
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 497051f46a0c6554b2f5978af94def74a122136a.
This commit is contained in:
+66
-1
@@ -41,9 +41,15 @@ default:
|
|||||||
- ./artifacts/
|
- ./artifacts/
|
||||||
|
|
||||||
.kubernetes-env: &kubernetes-env
|
.kubernetes-env: &kubernetes-env
|
||||||
|
retry:
|
||||||
|
max: 2
|
||||||
|
when:
|
||||||
|
- runner_system_failure
|
||||||
|
- unknown_failure
|
||||||
|
- api_failure
|
||||||
|
interruptible: true
|
||||||
tags:
|
tags:
|
||||||
- kubernetes-parity-build
|
- kubernetes-parity-build
|
||||||
interruptible: true
|
|
||||||
|
|
||||||
.docker-env: &docker-env
|
.docker-env: &docker-env
|
||||||
retry:
|
retry:
|
||||||
@@ -232,6 +238,28 @@ generate-impl-guide:
|
|||||||
script:
|
script:
|
||||||
- mdbook build roadmap/implementers-guide
|
- 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
|
.build-push-image: &build-push-image
|
||||||
<<: *kubernetes-env
|
<<: *kubernetes-env
|
||||||
image: quay.io/buildah/stable
|
image: quay.io/buildah/stable
|
||||||
@@ -393,6 +421,43 @@ publish-s3-release: &publish-s3
|
|||||||
- aws s3 ls s3://${AWS_BUCKET}/${PREFIX}/${EXTRATAG}/
|
- aws s3 ls s3://${AWS_BUCKET}/${PREFIX}/${EXTRATAG}/
|
||||||
--recursive --human-readable --summarize
|
--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
|
#### stage: deploy
|
||||||
|
|
||||||
deploy-polkasync-kusama:
|
deploy-polkasync-kusama:
|
||||||
|
|||||||
Reference in New Issue
Block a user