diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a46f3b5915e8..7d7d9e7cbdc6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,6 +46,14 @@ default: paths: - ./artifacts/ +.collect-artifacts-short: &collect-artifacts-short + artifacts: + name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}" + when: on_success + expire_in: 1 days + paths: + - ./artifacts/ + .kubernetes-env: &kubernetes-env retry: max: 2 @@ -559,27 +567,29 @@ build-rustdoc: script: # FIXME: it fails with `RUSTDOCFLAGS="-Dwarnings"` and `--all-features` # FIXME: return to stable when https://github.com/rust-lang/rust/issues/96937 gets into stable - - time cargo +nightly doc --workspace --verbose + - time cargo +nightly doc --workspace --verbose --no-deps - 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 "" > ./crate-docs/index.html - - sccache -s -generate-impl-guide: +build-implementers-guide: stage: stage3 # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs needs: - - job: check-transaction-versions + - job: test-deterministic-wasm artifacts: false <<: *test-refs <<: *docker-env - image: - name: michaelfbryan/mdbook-docker-image:v0.4.4 - entrypoint: [""] + <<: *collect-artifacts-short script: + - cargo install mdbook mdbook-mermaid mdbook-linkcheck - mdbook build ./roadmap/implementers-guide + - mkdir -p artifacts + - mv roadmap/implementers-guide/book artifacts/ + # FIXME: remove me after CI image gets nonroot + - chown -R nonroot:nonroot artifacts/ check-try-runtime: stage: stage3 @@ -858,7 +868,12 @@ publish-rustdoc: needs: - job: build-rustdoc artifacts: true + - job: build-implementers-guide + artifacts: true script: + # Save README and docs + - cp -r ./crate-docs/ /tmp/doc/ + - cp -r ./artifacts/book/ /tmp/ # setup ssh - eval $(ssh-agent) - ssh-add - <<< ${GITHUB_SSH_PRIV_KEY} @@ -870,13 +885,19 @@ publish-rustdoc: - git config remote.origin.url "git@github.com:/paritytech/${CI_PROJECT_NAME}.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 + - cp index.html /tmp + - cp README.md /tmp - rm -rf ./* - - mv /tmp/doc/* . + # dir for rustdoc + - mkdir -p doc + # dir for implementors guide + - mkdir -p book + - mv /tmp/doc/* doc/ + - mv /tmp/book/html/* book/ + - mv /tmp/index.html . + - mv /tmp/README.md . # Upload files - git add --all --force # `git commit` has an exit code of > 0 if there is nothing to commit. @@ -919,13 +940,8 @@ short-benchmark-westend: # This job cancels the whole pipeline if any of provided jobs fail. # In a DAG, every jobs chain is executed independently of others. The `fail_fast` principle suggests # to fail the pipeline as soon as possible to shorten the feedback loop. -cancel-pipeline: +.cancel-pipeline-template: stage: .post - needs: - - job: test-linux-stable - artifacts: false - - job: check-try-runtime - artifacts: false rules: - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs when: on_failure @@ -934,4 +950,14 @@ cancel-pipeline: PIPELINE_ID: "${CI_PIPELINE_ID}" trigger: "parity/infrastructure/ci_cd/pipeline-stopper" +cancel-pipeline-test-linux-stable: + extends: .cancel-pipeline-template + needs: + - job: test-linux-stable + artifacts: false +cancel-pipeline-check-try-runtime: + extends: .cancel-pipeline-template + needs: + - job: check-try-runtime + artifacts: false