Files
pezkuwi-subxt/polkadot/scripts/ci/gitlab/pipeline/check.yml
T
Alexander Samusev 896d1c2c3b [ci] Adjust check-runtime-migration job (#6107)
* [WIP][ci] Add node to check-runtime-migration job

* add image

* remove sscache from before_script

* add nodes

* restart pipeline

* restart pipeline2

* disable other jobs

* debug

* remove debug

* add ports

* restart pipeline

* restart pipeline

* restart pipeline

* try kusama first

* run polkadot 1st

* disable some jobs

* try command from command bot

* cargo run

* test passing variables

* run without condition

* adjust kusama and westend

* fix

* return jobs

* fix small nits

* split check-runtime-migration

Co-authored-by: parity-processbot <>
2022-12-08 13:26:18 +01:00

129 lines
4.2 KiB
YAML

# This file is part of .gitlab-ci.yml
# Here are all jobs that are executed during "check" stage
check-runtime:
stage: check
image: paritytech/tools:latest
extends:
- .kubernetes-env
rules:
- if: $CI_COMMIT_REF_NAME =~ /^release-v[0-9]+\.[0-9]+.*$/ # i.e. release-v0.9.27
variables:
GITLAB_API: "https://gitlab.parity.io/api/v4"
GITHUB_API_PROJECT: "parity%2Finfrastructure%2Fgithub-api"
script:
- ./scripts/ci/gitlab/check_runtime.sh
allow_failure: true
cargo-fmt:
stage: check
extends:
- .docker-env
- .test-refs
script:
- cargo +nightly --version
- cargo +nightly fmt --all -- --check
allow_failure: true
spellcheck:
stage: check
extends:
- .docker-env
- .test-refs
script:
- cargo spellcheck --version
# compare with the commit parent to the PR, given it's from a default branch
- git fetch origin +${CI_DEFAULT_BRANCH}:${CI_DEFAULT_BRANCH}
- echo "___Spellcheck is going to check your diff___"
- cargo spellcheck list-files -vvv $(git diff --diff-filter=AM --name-only $(git merge-base ${CI_COMMIT_SHA} ${CI_DEFAULT_BRANCH} -- :^bridges))
- time cargo spellcheck check -vvv --cfg=scripts/ci/gitlab/spellcheck.toml --checkers hunspell --code 1
$(git diff --diff-filter=AM --name-only $(git merge-base ${CI_COMMIT_SHA} ${CI_DEFAULT_BRANCH} -- :^bridges))
allow_failure: true
check-try-runtime:
stage: check
extends:
- .docker-env
- .test-refs
- .compiler-info
script:
# Check that everything compiles with `try-runtime` feature flag.
- cargo check --features try-runtime --all
# More info can be found here: https://github.com/paritytech/polkadot/pull/5865
# Works only in PRs with E1 label
.check-runtime-migration:
stage: check
extends:
- .docker-env
- .test-pr-refs
- .compiler-info
script:
- |
export has_runtimemigration_label=$(curl -sS -H "Accept: application/vnd.github+json" \
-H "Authorization: token $GITHUB_PR_TOKEN" \
https://api.github.com/repos/paritytech/polkadot/issues/$CI_COMMIT_REF_NAME/labels | grep "E1" | wc -l)
- |
if [[ $has_runtimemigration_label != 0 ]]; then
echo "Found label runtimemigration. Running tests"
export RUST_LOG=remote-ext=debug,runtime=debug
echo "---------- Running try-runtime for ${NETWORK} ----------"
time cargo run --release --features=try-runtime try-runtime --chain=${NETWORK}-dev --execution=Wasm --no-spec-check-panic on-runtime-upgrade live --uri wss://${NETWORK}-try-runtime-node.parity-chains.parity.io:443
else
echo "runtimemigration label not found. Skipping"
fi
check-runtime-migration-polkadot:
stage: check
extends:
- .docker-env
- .test-pr-refs
- .compiler-info
- .check-runtime-migration
variables:
NETWORK: "polkadot"
check-runtime-migration-kusama:
stage: check
extends:
- .docker-env
- .test-pr-refs
- .compiler-info
- .check-runtime-migration
variables:
NETWORK: "kusama"
check-runtime-migration-westend:
stage: check
extends:
- .docker-env
- .test-pr-refs
- .compiler-info
- .check-runtime-migration
variables:
NETWORK: "westend"
allow_failure: true
# is broken, need to fix
check-no-default-features:
stage: check
extends:
- .docker-env
- .test-refs
- .compiler-info
script:
# Check that polkadot-cli will compile no default features.
- pushd ./node/service && cargo check --no-default-features && popd
- pushd ./cli && cargo check --no-default-features --features "service" && popd
- exit 0
# this is artificial job to run some build and tests using DAG
job-starter:
stage: check
image: paritytech/tools:latest
extends:
- .kubernetes-env
- .common-refs
script:
- echo ok