[ci] .gitlab-ci.yml chores (#4663)

* rename malus.Dockerfile

* ci chores

* fix pipeline
This commit is contained in:
Alexander Samusev
2022-01-06 12:25:24 +01:00
committed by GitHub
parent b9e6d96c87
commit 041543882b
2 changed files with 48 additions and 40 deletions
+48 -40
View File
@@ -5,8 +5,8 @@
# pipelines can be triggered manually in the web # pipelines can be triggered manually in the web
# setting DEPLOY_TAG will only deploy the tagged image # setting DEPLOY_TAG will only deploy the tagged image
# #
# please do not add new jobs without "rules:" and "*-env". There are &rules-test for everything, # please do not add new jobs without "rules:" and "*-env". There are &test-refs for everything,
# &rules-test-and-rococo preset. And "kubernetes-env" with "docker-env" to set a runner # &test-and-rococo-refs preset. And "kubernetes-env" with "docker-env" to set a runner
# which executes the job. # which executes the job.
stages: stages:
@@ -73,7 +73,7 @@ default:
- cargo --version - cargo --version
- sccache -s - sccache -s
.rules-test: &rules-test .test-refs: &test-refs
# these jobs run always* # these jobs run always*
rules: rules:
- if: $CI_COMMIT_REF_NAME == "rococo-v1" - if: $CI_COMMIT_REF_NAME == "rococo-v1"
@@ -82,17 +82,35 @@ default:
- if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
.rules-test-and-rococo: &rules-test-and-rococo .test-and-rococo-refs: &test-and-rococo-refs
rules: rules:
- if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
- if: $CI_COMMIT_REF_NAME == "rococo-v1" - if: $CI_COMMIT_REF_NAME == "rococo-v1"
.rules-test-pr: &rules-test-pr .test-pr-refs: &test-pr-refs
rules: rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
.zombienet-refs: &zombienet-refs
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
- if: $CI_COMMIT_REF_NAME == "rococo-v1"
.publish-refs: &publish-refs
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
#### Vault secrets #### Vault secrets
.vault-secrets: &vault-secrets .vault-secrets: &vault-secrets
secrets: secrets:
@@ -151,7 +169,7 @@ check-runtime:
stage: test stage: test
image: paritytech/tools:latest image: paritytech/tools:latest
<<: *kubernetes-env <<: *kubernetes-env
<<: *rules-test <<: *test-refs
<<: *vault-secrets <<: *vault-secrets
variables: variables:
GITLAB_API: "https://gitlab.parity.io/api/v4" GITLAB_API: "https://gitlab.parity.io/api/v4"
@@ -163,7 +181,7 @@ check-runtime:
cargo-fmt: cargo-fmt:
stage: test stage: test
<<: *docker-env <<: *docker-env
<<: *rules-test <<: *test-refs
script: script:
- cargo +nightly --version - cargo +nightly --version
- cargo +nightly fmt --all -- --check - cargo +nightly fmt --all -- --check
@@ -171,7 +189,7 @@ cargo-fmt:
test-deterministic-wasm: test-deterministic-wasm:
stage: test stage: test
<<: *rules-test <<: *test-refs
<<: *docker-env <<: *docker-env
<<: *compiler-info <<: *compiler-info
<<: *vault-secrets <<: *vault-secrets
@@ -218,7 +236,7 @@ test-build-linux-stable:
check-runtime-benchmarks: check-runtime-benchmarks:
stage: test stage: test
<<: *rules-test <<: *test-refs
<<: *docker-env <<: *docker-env
<<: *compiler-info <<: *compiler-info
<<: *vault-secrets <<: *vault-secrets
@@ -229,7 +247,7 @@ check-runtime-benchmarks:
check-no-default-features: check-no-default-features:
stage: test stage: test
<<: *rules-test <<: *test-refs
<<: *docker-env <<: *docker-env
<<: *compiler-info <<: *compiler-info
<<: *vault-secrets <<: *vault-secrets
@@ -241,7 +259,7 @@ check-no-default-features:
spellcheck: spellcheck:
stage: test stage: test
<<: *docker-env <<: *docker-env
<<: *rules-test <<: *test-refs
script: script:
- cargo spellcheck --version - cargo spellcheck --version
# compare with the commit parent to the PR, given it's from a default branch # compare with the commit parent to the PR, given it's from a default branch
@@ -257,7 +275,7 @@ build-adder-collator:
<<: *collect-artifacts <<: *collect-artifacts
<<: *docker-env <<: *docker-env
<<: *compiler-info <<: *compiler-info
<<: *rules-test-and-rococo <<: *test-and-rococo-refs
script: script:
- time cargo build --profile testnet --verbose -p test-parachain-adder-collator - time cargo build --profile testnet --verbose -p test-parachain-adder-collator
- sccache -s - sccache -s
@@ -274,10 +292,7 @@ build-malus:
<<: *collect-artifacts <<: *collect-artifacts
<<: *docker-env <<: *docker-env
<<: *compiler-info <<: *compiler-info
rules: <<: *test-and-rococo-refs
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
script: script:
- time cargo build --profile testnet --verbose -p polkadot-test-malus - time cargo build --profile testnet --verbose -p polkadot-test-malus
- sccache -s - sccache -s
@@ -294,7 +309,7 @@ build-malus:
.check-dependent-project: &check-dependent-project .check-dependent-project: &check-dependent-project
stage: build stage: build
<<: *docker-env <<: *docker-env
<<: *rules-test-pr <<: *test-pr-refs
<<: *vault-secrets <<: *vault-secrets
script: script:
- git clone - git clone
@@ -317,7 +332,7 @@ check-dependent-cumulus:
check-transaction-versions: check-transaction-versions:
stage: build stage: build
<<: *rules-test <<: *test-refs
<<: *docker-env <<: *docker-env
<<: *vault-secrets <<: *vault-secrets
image: node:15 image: node:15
@@ -335,7 +350,7 @@ check-transaction-versions:
generate-impl-guide: generate-impl-guide:
stage: build stage: build
<<: *rules-test <<: *test-refs
<<: *docker-env <<: *docker-env
image: image:
name: michaelfbryan/mdbook-docker-image:v0.4.4 name: michaelfbryan/mdbook-docker-image:v0.4.4
@@ -346,7 +361,7 @@ generate-impl-guide:
build-rustdoc: build-rustdoc:
stage: build stage: build
<<: *docker-env <<: *docker-env
<<: *rules-test <<: *test-refs
variables: variables:
SKIP_WASM_BUILD: 1 SKIP_WASM_BUILD: 1
artifacts: artifacts:
@@ -411,6 +426,8 @@ publish-polkadot-image:
rules: rules:
# Don't run on releases - this is handled by the Github Action here: # Don't run on releases - this is handled by the Github Action here:
# .github/workflows/publish-docker-release.yml # .github/workflows/publish-docker-release.yml
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
when: never when: never
- if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_PIPELINE_SOURCE == "schedule"
@@ -439,7 +456,7 @@ publish-adder-collator-image:
# service image for Simnet # service image for Simnet
stage: build stage: build
<<: *build-push-image <<: *build-push-image
<<: *rules-test-and-rococo <<: *zombienet-refs
variables: variables:
<<: *image-variables <<: *image-variables
# scripts/dockerfiles/collator_injected.Dockerfile # scripts/dockerfiles/collator_injected.Dockerfile
@@ -462,15 +479,12 @@ publish-malus-image:
# service image for Simnet # service image for Simnet
stage: build stage: build
<<: *build-push-image <<: *build-push-image
<<: *zombienet-refs
variables: variables:
<<: *image-variables <<: *image-variables
# scripts/dockerfiles/malus.Dockerfile # scripts/dockerfiles/malus_injected.Dockerfile
DOCKERFILE: dockerfiles/malus.Dockerfile DOCKERFILE: dockerfiles/malus_injected.Dockerfile
IMAGE_NAME: docker.io/paritypr/malus IMAGE_NAME: docker.io/paritypr/malus
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
needs: needs:
- job: build-malus - job: build-malus
artifacts: true artifacts: true
@@ -523,6 +537,8 @@ publish-s3-release: &publish-s3
GIT_STRATEGY: none GIT_STRATEGY: none
PREFIX: "builds/polkadot/${ARCH}-${DOCKER_OS}" PREFIX: "builds/polkadot/${ARCH}-${DOCKER_OS}"
rules: rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
# publishing binaries nightly # publishing binaries nightly
- if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_PIPELINE_SOURCE == "schedule"
before_script: before_script:
@@ -558,6 +574,8 @@ publish-rustdoc:
variables: variables:
GIT_DEPTH: 100 GIT_DEPTH: 100
rules: rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_REF_NAME == "master" - if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME == "master"
# `needs:` can be removed after CI image gets nonroot. In this case `needs:` stops other # `needs:` can be removed after CI image gets nonroot. In this case `needs:` stops other
@@ -601,9 +619,7 @@ publish-rustdoc:
deploy-parity-testnet: deploy-parity-testnet:
stage: deploy stage: deploy
rules: <<: *publish-refs
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
variables: variables:
POLKADOT_CI_COMMIT_NAME: "${CI_COMMIT_REF_NAME}" POLKADOT_CI_COMMIT_NAME: "${CI_COMMIT_REF_NAME}"
POLKADOT_CI_COMMIT_REF: "${CI_COMMIT_SHORT_SHA}" POLKADOT_CI_COMMIT_REF: "${CI_COMMIT_SHORT_SHA}"
@@ -614,11 +630,7 @@ zombienet-tests-parachains-smoke-test:
stage: deploy stage: deploy
image: "${ZOMBIENET_IMAGE}" image: "${ZOMBIENET_IMAGE}"
<<: *kubernetes-env <<: *kubernetes-env
rules: <<: *zombienet-refs
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
- if: $CI_COMMIT_REF_NAME == "rococo-v1"
needs: needs:
- job: publish-polkadot-image - job: publish-polkadot-image
- job: publish-malus-image - job: publish-malus-image
@@ -651,11 +663,7 @@ zombienet-tests-malus-dispute-valid:
stage: deploy stage: deploy
image: "${ZOMBIENET_IMAGE}" image: "${ZOMBIENET_IMAGE}"
<<: *kubernetes-env <<: *kubernetes-env
rules: <<: *zombienet-refs
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
- if: $CI_COMMIT_REF_NAME == "rococo-v1"
needs: needs:
- job: publish-polkadot-image - job: publish-polkadot-image
- job: publish-malus-image - job: publish-malus-image