From a5cab922a57fcb3ffa6a2c06b9e6ddd62a30bddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Silva=20de=20Souza?= <77391175+joao-paulo-parity@users.noreply.github.com> Date: Fri, 16 Dec 2022 09:29:55 -0300 Subject: [PATCH] Set WASM_BUILD_WORKSPACE_HINT before starting CI jobs (#12816) * set WASM_BUILD_WORKSPACE_HINT this enables wasm-builder to find the Cargo.lock from within generated packages * wip: try out https://github.com/paritytech/pipeline-scripts/pull/90 * wip: fixup * wip * revert ci skip * set up WASM_BUILD_WORKSPACE_HINT for .kubernetes-env as well * Update scripts/ci/gitlab/pipeline/publish.yml Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> --- substrate/.gitlab-ci.yml | 13 +++++++++++-- substrate/scripts/ci/gitlab/pipeline/publish.yml | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/substrate/.gitlab-ci.yml b/substrate/.gitlab-ci.yml index dcc0cbb7c9..145a25c809 100644 --- a/substrate/.gitlab-ci.yml +++ b/substrate/.gitlab-ci.yml @@ -81,6 +81,15 @@ default: paths: - artifacts/ +.prepare-env: + before_script: + # TODO: remove unset invocation when we'll be free from 'ENV RUSTC_WRAPPER=sccache' & sccache + # itself in all images + - unset RUSTC_WRAPPER + # $WASM_BUILD_WORKSPACE_HINT enables wasm-builder to find the Cargo.lock from within generated + # packages + - export WASM_BUILD_WORKSPACE_HINT="$PWD" + .job-switcher: before_script: - if echo "$CI_DISABLED_JOBS" | grep -xF "$CI_JOB_NAME"; then echo "The job has been cancelled in CI settings"; exit 0; fi @@ -89,6 +98,7 @@ default: image: "${CI_IMAGE}" before_script: - !reference [.job-switcher, before_script] + - !reference [.prepare-env, before_script] tags: - kubernetes-parity-build @@ -115,9 +125,8 @@ default: .docker-env: image: "${CI_IMAGE}" before_script: - # TODO: remove unset invocation when we'll be free from 'ENV RUSTC_WRAPPER=sccache' & sccache itself in all images - - unset RUSTC_WRAPPER - !reference [.job-switcher, before_script] + - !reference [.prepare-env, before_script] - !reference [.rust-info-script, script] - !reference [.rusty-cachier, before_script] - !reference [.pipeline-stopper-vars, script] diff --git a/substrate/scripts/ci/gitlab/pipeline/publish.yml b/substrate/scripts/ci/gitlab/pipeline/publish.yml index 68a10e8aa1..f2fd64bc34 100644 --- a/substrate/scripts/ci/gitlab/pipeline/publish.yml +++ b/substrate/scripts/ci/gitlab/pipeline/publish.yml @@ -12,7 +12,7 @@ DOCKERFILE: $PRODUCT.Dockerfile IMAGE_NAME: docker.io/$IMAGE_PATH before_script: - - !reference [.job-switcher, before_script] + - !reference [.kubernetes-env, before_script] - cd ./artifacts/$PRODUCT/ - VERSION="$(cat ./VERSION)" - echo "${PRODUCT} version = ${VERSION}"