diff --git a/.docker/Dockerfile-unique b/.docker/Dockerfile-unique index 98484afb12..57ed7a93fb 100644 --- a/.docker/Dockerfile-unique +++ b/.docker/Dockerfile-unique @@ -6,18 +6,10 @@ WORKDIR /workdir COPY . unique-chain/ ARG FEATURES -# registry for Updating registry. It is safe to cache it, because it only contains references to the dependency files, -# and the caches for the files themselves are set in Cargo.lock, which won't be updated because of --locked flag -# git for Updating git repository. It is safe to cache it, because git dependencies are cached by revision, -# revision is locked in Cargo.lock, and it is forbidden to update the Cargo.lock, because of --locked flag -# passed to cargo build -# target for built dependencies. Technically, it may be unsafe to cache it, but there was no bugs in the caching logic -# of it to this day (Ignoring incremental compilation, which is explicitly disabled by CARGO_INCREMENTAL=0). Only the -# fully built crates will be cached depending on the crate source, version and feature set, which are locked by -# Cargo.lock, which can't be updated because of the --locked flag. + RUN cd unique-chain && \ echo "Using runtime features ${FEATURES}" && \ - CARGO_INCREMENTAL=0 cargo build --profile integration-tests --features=fast-inflation,"${FEATURES}" --locked && \ + CARGO_INCREMENTAL=0; WASM_BUILD_TYPE=integration-tests; cargo build --profile integration-tests --features=fast-inflation,"${FEATURES}" --locked && \ mv ./target/integration-tests/unique-collator /workdir/unique-chain/ && \ cd target/integration-tests/wbuild && find . -name "*.wasm" -exec sh -c 'mkdir -p "../../../wasm/$(dirname {})"; cp {} "../../../wasm/{}"' \; diff --git a/.docker/Dockerfile-unique-release b/.docker/Dockerfile-unique-release index cc95ea6db6..7e155a2bd0 100644 --- a/.docker/Dockerfile-unique-release +++ b/.docker/Dockerfile-unique-release @@ -9,7 +9,7 @@ ARG FEATURES RUN git clone -b "${CODE_VERSION}" https://github.com/uniquenetwork/unique-chain.git && \ cd unique-chain && git switch "${CODE_HASH}" --detach && \ - CARGO_INCREMENTAL=0 cargo build --release --features="${FEATURES}" --locked && \ + CARGO_INCREMENTAL=0; cargo build --release --features="${FEATURES}" --locked && \ mv ./target/release/unique-collator /workdir/unique-chain/ && \ cd target/release/wbuild && find . -name "*.wasm" -exec sh -c 'mkdir -p "../../../wasm/$(dirname {})"; cp {} "../../../wasm/{}"' \; diff --git a/.github/actions/buildContainer/action.yml b/.github/actions/buildContainer/action.yml index f6f56a4b81..01bbdf7b82 100644 --- a/.github/actions/buildContainer/action.yml +++ b/.github/actions/buildContainer/action.yml @@ -41,13 +41,13 @@ runs: echo "Available tags:" echo "$TAGS" - # Check correct version POLKADOT and build it if it doesn't exist in POLKADOT TAGS + # Check correct version and build it if it doesn't exist in TAGS if [[ ${TAGS[*]} =~ (^|[[:space:]])"${{ inputs.tag }}"($|[[:space:]]) ]]; then echo "Repository has needed version, pulling"; docker pull ${{ inputs.container }}:${{ inputs.tag }} else echo "Repository had no needed version, so build it"; - cd "${{ inputs.context }}" && docker build --file "${{ inputs.dockerfile }}" \ + cd "${{ inputs.context }}" && docker build --no-cache --file "${{ inputs.dockerfile }}" \ $BUILD_ARGS --tag ${{ inputs.container }}:${{ inputs.tag }} \ . echo "Push built version to the repository";