Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

[ci] build runtime only if runtime files were changed #1582

Merged
merged 25 commits into from
Sep 19, 2022
Merged
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 74 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ build-test-parachain:
variables:
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: check-rustdoc
Expand All @@ -248,9 +248,81 @@ build-test-parachain:
- mkdir -p ./artifacts/zombienet
- mv ./target/release/wbuild/cumulus-test-runtime/wasm_binary_spec_version_incremented.rs.compact.compressed.wasm ./artifacts/zombienet/.

# build runtime only if files in $RUNTIME_PATH/$RUNTIME_NAME were changed
.build-runtime-template: &build-runtime-template
stage: build
<<: *docker-env
needs:
- job: check-rustdoc
artifacts: false
variables:
RUNTIME_PATH: "parachains/runtimes/assets"
RUNTIME_NAME: "statemine"
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
changes:
- $RUNTIME_PATH/$RUNTIME_NAME/**/*
script:
- cd ${RUNTIME_PATH}/${RUNTIME_NAME}
- SKIP_WASM_BUILD=1 cargo check

build-runtime-assets-statemine:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "parachains/runtimes/assets"
RUNTIME_NAME: "statemine"

build-runtime-assets-statemint:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "parachains/runtimes/assets"
RUNTIME_NAME: "statemint"

build-runtime-assets-westmint:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "parachains/runtimes/assets"
RUNTIME_NAME: "westmint"

build-runtime-collectives-collectives-polkadot:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "parachains/runtimes/collectives"
RUNTIME_NAME: "collectives-polkadot"

build-runtime-contracts-contracts-rococo:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "parachains/runtimes/contracts"
RUNTIME_NAME: "contracts-rococo"

build-runtime-starters-shell:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "parachains/runtimes/starters"
RUNTIME_NAME: "shell"

build-runtime-starters-seedling:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "parachains/runtimes/starters"
RUNTIME_NAME: "seedling"

build-runtime-testing-penpal:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "parachains/runtimes/testing"
RUNTIME_NAME: "penpal"

build-runtime-testing-rococo-parachain:
<<: *build-runtime-template
variables:
RUNTIME_PATH: "parachains/runtimes/testing"
RUNTIME_NAME: "rococo-parachain"

#### stage: publish

.build-push-image: &build-push-image
.build-push-image: &build-push-image
image: quay.io/buildah/stable
variables:
DOCKERFILE: "" # docker/path-to.Dockerfile
Expand Down