diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c4d0ad28ed4..03822efb4a9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 @@ -248,9 +248,74 @@ 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 + <<: *pr-refs + # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs + needs: + - job: check-rustdoc + artifacts: false + variables: + RUNTIME_PATH: "parachains/runtimes/assets" + script: + - cd ${RUNTIME_PATH} + - for directory in $(echo */); do + echo "_____Running cargo check for ${directory} ______"; + cd ${directory}; + pwd; + SKIP_WASM_BUILD=1 cargo check; + cd ..; + done + +# DAG: build-runtime-assets -> build-runtime-collectives -> build-runtime-contracts +# DAG: build-runtime-assets ->build-runtime-starters -> build-runtime-testing +build-runtime-assets: + <<: *build-runtime-template + variables: + RUNTIME_PATH: "parachains/runtimes/assets" + +build-runtime-collectives: + <<: *build-runtime-template + variables: + RUNTIME_PATH: "parachains/runtimes/collectives" + # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs + needs: + - job: build-runtime-assets + artifacts: false + +build-runtime-contracts: + <<: *build-runtime-template + variables: + RUNTIME_PATH: "parachains/runtimes/contracts" + # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs + needs: + - job: build-runtime-collectives + artifacts: false + +build-runtime-starters: + <<: *build-runtime-template + variables: + RUNTIME_PATH: "parachains/runtimes/starters" + # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs + needs: + - job: build-runtime-assets + artifacts: false + +build-runtime-testing: + <<: *build-runtime-template + variables: + RUNTIME_PATH: "parachains/runtimes/testing" + # this is an artificial job dependency, for pipeline optimization using GitLab's DAGs + needs: + - job: build-runtime-starters + artifacts: false + + #### 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