From 545e27cc37f8562a2b75cda2d2ae1af6d72fd7c5 Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 25 Nov 2019 13:18:19 +0100 Subject: [PATCH 01/24] cli is built and sent to examples; cleanup CI --- .gitlab-ci.yml | 50 +++++++++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b38d447a06..26c2f45c30 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -61,9 +61,7 @@ check-std: stage: check <<: *docker-env script: - - for crate in ${ALL_CRATES}; do - cargo check --verbose --all-features; - done + - cargo check --verbose --all-features; check-wasm: stage: check @@ -73,23 +71,29 @@ check-wasm: cargo check --verbose --no-default-features --target wasm32-unknown-unknown --manifest-path ${crate}/Cargo.toml; done +build-cli: + stage: check + <<: *docker-env + script: + - cargo build --manifest-path cli/Cargo.toml --release + artifacts: + name: cli_${CI_COMMIT_SHORT_SHA} + expire_in: 24 hrs + paths: + - ./target/release/cargo-contract + + #### stage: workspace build-std: stage: workspace <<: *docker-env - dependencies: - - check-std script: - - for crate in ${ALL_CRATES}; do - cargo build --verbose --all-features --release; - done + - cargo build --verbose --all-features --release build-wasm: stage: workspace <<: *docker-env - dependencies: - - check-wasm script: - for crate in ${WASM_CRATES}; do cargo build --verbose --no-default-features --release --target wasm32-unknown-unknown --manifest-path ${crate}/Cargo.toml; @@ -98,28 +102,18 @@ build-wasm: test: stage: workspace <<: *docker-env - dependencies: - - check-std script: - - for crate in ${ALL_CRATES}; do - cargo test --verbose --all-features --release; - done + - cargo test --verbose --all-features --release clippy-std: stage: workspace <<: *docker-env - dependencies: - - check-std script: - - for crate in ${ALL_CRATES}; do - cargo clippy --verbose --all-features -- -D warnings; - done + - cargo clippy --verbose --all-features -- -D warnings clippy-wasm: stage: workspace <<: *docker-env - dependencies: - - check-wasm script: - for crate in ${WASM_CRATES}; do cargo clippy --verbose --manifest-path ${crate}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings; @@ -129,9 +123,7 @@ fmt: stage: workspace <<: *docker-env script: - - for crate in ${ALL_CRATES}; do - cargo fmt --verbose -- --check; - done + - cargo fmt --verbose -- --check #### stage: examples @@ -171,19 +163,23 @@ examples-clippy-wasm: examples-contract-build: stage: examples <<: *docker-env + dependencies: + - build-cli script: - for example in examples/lang2/*; do pushd $example && - cargo contract build && + ./target/release/cargo-contract build && popd; done examples-generate-metadata: stage: examples <<: *docker-env + dependencies: + - build-cli script: - for example in examples/lang2/*; do pushd $example && - cargo contract generate-metadata && + ./target/release/cargo-contract generate-metadata && popd; done From 6579c50cf6a94599b94fd789df05cf62ed38947d Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 25 Nov 2019 16:12:14 +0100 Subject: [PATCH 02/24] fix artifact location --- .gitlab-ci.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 26c2f45c30..77c4eca585 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,6 +45,7 @@ variables: - schedules - web - /^[0-9]+$/ # PRs + dependencies: [] retry: max: 2 when: @@ -76,6 +77,7 @@ build-cli: <<: *docker-env script: - cargo build --manifest-path cli/Cargo.toml --release + - ./target/release/cargo-contract -V artifacts: name: cli_${CI_COMMIT_SHORT_SHA} expire_in: 24 hrs @@ -166,9 +168,12 @@ examples-contract-build: dependencies: - build-cli script: + - ls -la + - ls ./target/release/ + - ./target/release/cargo-contract -V - for example in examples/lang2/*; do - pushd $example && - ./target/release/cargo-contract build && + pushd $example && pwd && echo ${CI_BUILDS_DIR} + ${CI_PROJECT_DIR}/target/release/cargo-contract build && popd; done @@ -178,8 +183,11 @@ examples-generate-metadata: dependencies: - build-cli script: + - ls -la + - ls ./target/release/ + - ./target/release/cargo-contract -V - for example in examples/lang2/*; do - pushd $example && - ./target/release/cargo-contract generate-metadata && + pushd $example && pwd && echo ${CI_BUILDS_DIR} + ${CI_PROJECT_DIR}/target/release/cargo-contract generate-metadata && popd; done From d1f503b2aa729790a3c2d7e41e361f281e567241 Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 25 Nov 2019 17:17:18 +0100 Subject: [PATCH 03/24] fix script --- .gitlab-ci.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 77c4eca585..3d97223f75 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -90,12 +90,16 @@ build-cli: build-std: stage: workspace <<: *docker-env + needs: + - check-std script: - cargo build --verbose --all-features --release build-wasm: stage: workspace <<: *docker-env + needs: + - check-wasm script: - for crate in ${WASM_CRATES}; do cargo build --verbose --no-default-features --release --target wasm32-unknown-unknown --manifest-path ${crate}/Cargo.toml; @@ -104,18 +108,24 @@ build-wasm: test: stage: workspace <<: *docker-env + needs: + - check-std script: - cargo test --verbose --all-features --release clippy-std: stage: workspace <<: *docker-env + needs: + - check-std script: - cargo clippy --verbose --all-features -- -D warnings clippy-wasm: stage: workspace <<: *docker-env + needs: + - check-wasm script: - for crate in ${WASM_CRATES}; do cargo clippy --verbose --manifest-path ${crate}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings; @@ -167,12 +177,12 @@ examples-contract-build: <<: *docker-env dependencies: - build-cli + needs: + - build-cli script: - - ls -la - - ls ./target/release/ - ./target/release/cargo-contract -V - for example in examples/lang2/*; do - pushd $example && pwd && echo ${CI_BUILDS_DIR} + pushd $example && pwd && echo ${CI_BUILDS_DIR} && ${CI_PROJECT_DIR}/target/release/cargo-contract build && popd; done @@ -182,12 +192,12 @@ examples-generate-metadata: <<: *docker-env dependencies: - build-cli + needs: + - build-cli script: - - ls -la - - ls ./target/release/ - ./target/release/cargo-contract -V - for example in examples/lang2/*; do - pushd $example && pwd && echo ${CI_BUILDS_DIR} + pushd $example && pwd && echo ${CI_BUILDS_DIR} && ${CI_PROJECT_DIR}/target/release/cargo-contract generate-metadata && popd; done From ccc0f24da54e114e93b8a00c7c4a6763a6185696 Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 25 Nov 2019 17:48:46 +0100 Subject: [PATCH 04/24] 'install' cargo-contract --- .gitlab-ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3d97223f75..07af159260 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -180,10 +180,11 @@ examples-contract-build: needs: - build-cli script: - - ./target/release/cargo-contract -V + - cp target/release/cargo-contract ~/.cargo/bin/ + - cargo contract -V - for example in examples/lang2/*; do - pushd $example && pwd && echo ${CI_BUILDS_DIR} && - ${CI_PROJECT_DIR}/target/release/cargo-contract build && + pushd $example && + cargo contract build && popd; done @@ -195,9 +196,10 @@ examples-generate-metadata: needs: - build-cli script: - - ./target/release/cargo-contract -V + - cp target/release/cargo-contract ~/.cargo/bin/ + - cargo contract -V - for example in examples/lang2/*; do - pushd $example && pwd && echo ${CI_BUILDS_DIR} && - ${CI_PROJECT_DIR}/target/release/cargo-contract generate-metadata && + pushd $example && + cargo contract generate-metadata && popd; done From af6e935a7bdcbbd31c6939d6db527fe6480f3629 Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 25 Nov 2019 20:52:39 +0100 Subject: [PATCH 05/24] save before merge --- .gitlab-ci.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 07af159260..750f50ca6d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,6 +46,7 @@ variables: - web - /^[0-9]+$/ # PRs dependencies: [] + interruptible: true retry: max: 2 when: @@ -76,13 +77,19 @@ build-cli: stage: check <<: *docker-env script: - - cargo build --manifest-path cli/Cargo.toml --release - - ./target/release/cargo-contract -V + # - cargo build --manifest-path cli/Cargo.toml --release + - cargo install --git https://github.com/paritytech/cargo-contract --force + # - git clone --depth 1 https://github.com/paritytech/cargo-contract + # - pushd cargo-contract + # - cargo build --manifest-path cli/Cargo.toml --release + # - popd + # - ./target/release/cargo-contract -V artifacts: name: cli_${CI_COMMIT_SHORT_SHA} expire_in: 24 hrs paths: - - ./target/release/cargo-contract + # - ./target/release/cargo-contract + - /usr/local/cargo/bin/cargo-contract #### stage: workspace @@ -180,7 +187,7 @@ examples-contract-build: needs: - build-cli script: - - cp target/release/cargo-contract ~/.cargo/bin/ + # - cp target/release/cargo-contract /usr/local/cargo/bin/ - cargo contract -V - for example in examples/lang2/*; do pushd $example && @@ -196,7 +203,7 @@ examples-generate-metadata: needs: - build-cli script: - - cp target/release/cargo-contract ~/.cargo/bin/ + # - cp target/release/cargo-contract /usr/local/cargo/bin/ - cargo contract -V - for example in examples/lang2/*; do pushd $example && From a591b0ab41f79c284a18d2703a9cba13290cdd00 Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 25 Nov 2019 22:16:52 +0100 Subject: [PATCH 06/24] GIT_DEPTH and some hackery --- .gitlab-ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5970e644e3..3fc3dde66d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,6 +12,7 @@ stages: variables: GIT_STRATEGY: fetch + GIT_DEPTH: "3" CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}" SCCACHE_DIR: "/ci-cache/${CI_PROJECT_NAME}/sccache" CARGO_INCREMENTAL: 0 @@ -85,12 +86,15 @@ build-cli: # - cargo build --manifest-path cli/Cargo.toml --release # - popd # - ./target/release/cargo-contract -V + - which cargo-contract + - cp (which cargo-contract) /artifacts/ artifacts: name: cli_${CI_COMMIT_SHORT_SHA} expire_in: 24 hrs paths: # - ./target/release/cargo-contract - - /usr/local/cargo/bin/cargo-contract + # - /usr/local/cargo/bin/cargo-contract + - /artifacts/cargo-contract #### stage: workspace @@ -195,6 +199,7 @@ examples-contract-build: - build-cli script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ + - cp /artifacts/cargo-contract /usr/local/cargo/bin/ - cargo contract -V - for example in examples/lang2/*; do pushd $example && @@ -211,6 +216,7 @@ examples-generate-metadata: - build-cli script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ + - cp /artifacts/cargo-contract /usr/local/cargo/bin/ - cargo contract -V - for example in examples/lang2/*; do pushd $example && From 2b7f1413e22b6323b904d13338fe552d90da34c4 Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 25 Nov 2019 22:27:30 +0100 Subject: [PATCH 07/24] typo --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3fc3dde66d..b94c3c50a5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -87,7 +87,7 @@ build-cli: # - popd # - ./target/release/cargo-contract -V - which cargo-contract - - cp (which cargo-contract) /artifacts/ + - cp $(which cargo-contract) /artifacts/ artifacts: name: cli_${CI_COMMIT_SHORT_SHA} expire_in: 24 hrs From daa097c6a9c3a7b2fe360921ac60332d85ec85dc Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 25 Nov 2019 22:43:46 +0100 Subject: [PATCH 08/24] fix artifacts --- .gitlab-ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b94c3c50a5..1ebc9a9197 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -87,14 +87,15 @@ build-cli: # - popd # - ./target/release/cargo-contract -V - which cargo-contract - - cp $(which cargo-contract) /artifacts/ + - mkdir -p ./artifacts/ + - cp $(which cargo-contract) ./artifacts/ artifacts: name: cli_${CI_COMMIT_SHORT_SHA} expire_in: 24 hrs paths: # - ./target/release/cargo-contract # - /usr/local/cargo/bin/cargo-contract - - /artifacts/cargo-contract + - artifacts/ #### stage: workspace @@ -199,7 +200,7 @@ examples-contract-build: - build-cli script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ - - cp /artifacts/cargo-contract /usr/local/cargo/bin/ + - cp artifacts/cargo-contract /usr/local/cargo/bin/ - cargo contract -V - for example in examples/lang2/*; do pushd $example && @@ -216,7 +217,7 @@ examples-generate-metadata: - build-cli script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ - - cp /artifacts/cargo-contract /usr/local/cargo/bin/ + - cp artifacts/cargo-contract /usr/local/cargo/bin/ - cargo contract -V - for example in examples/lang2/*; do pushd $example && From 573ca9f95095fb3e142a6294e2ab2061e4d7d5a4 Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 25 Nov 2019 22:51:16 +0100 Subject: [PATCH 09/24] test --- .gitlab-ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1ebc9a9197..81b41fd18a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -200,7 +200,11 @@ examples-contract-build: - build-cli script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ + - which cargo-contract + - cargo uninstall cargo-contract + - which cargo-contract - cp artifacts/cargo-contract /usr/local/cargo/bin/ + - which cargo-contract - cargo contract -V - for example in examples/lang2/*; do pushd $example && @@ -217,7 +221,11 @@ examples-generate-metadata: - build-cli script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ + - which cargo-contract + - cargo uninstall cargo-contract + - which cargo-contract - cp artifacts/cargo-contract /usr/local/cargo/bin/ + - which cargo-contract - cargo contract -V - for example in examples/lang2/*; do pushd $example && From f354a6843ca6f5dfc6311cb082be0b4f739ccd10 Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 25 Nov 2019 22:58:47 +0100 Subject: [PATCH 10/24] test2 --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 81b41fd18a..3e4fe40085 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -201,10 +201,10 @@ examples-contract-build: script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ - which cargo-contract - - cargo uninstall cargo-contract - - which cargo-contract + - stat $(which cargo-contract) - cp artifacts/cargo-contract /usr/local/cargo/bin/ - which cargo-contract + - stat $(which cargo-contract) - cargo contract -V - for example in examples/lang2/*; do pushd $example && @@ -222,10 +222,10 @@ examples-generate-metadata: script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ - which cargo-contract - - cargo uninstall cargo-contract - - which cargo-contract + - stat $(which cargo-contract) - cp artifacts/cargo-contract /usr/local/cargo/bin/ - which cargo-contract + - stat $(which cargo-contract) - cargo contract -V - for example in examples/lang2/*; do pushd $example && From f7d2eaae315cec1e560308965f6c281479fcc958 Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 26 Nov 2019 00:01:52 +0100 Subject: [PATCH 11/24] test3 --- .gitlab-ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3e4fe40085..fd6db618ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -79,7 +79,6 @@ build-cli: stage: check <<: *docker-env script: - # - cargo build --manifest-path cli/Cargo.toml --release - cargo install --git https://github.com/paritytech/cargo-contract --force # - git clone --depth 1 https://github.com/paritytech/cargo-contract # - pushd cargo-contract @@ -94,7 +93,6 @@ build-cli: expire_in: 24 hrs paths: # - ./target/release/cargo-contract - # - /usr/local/cargo/bin/cargo-contract - artifacts/ @@ -200,8 +198,6 @@ examples-contract-build: - build-cli script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ - - which cargo-contract - - stat $(which cargo-contract) - cp artifacts/cargo-contract /usr/local/cargo/bin/ - which cargo-contract - stat $(which cargo-contract) @@ -221,8 +217,6 @@ examples-generate-metadata: - build-cli script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ - - which cargo-contract - - stat $(which cargo-contract) - cp artifacts/cargo-contract /usr/local/cargo/bin/ - which cargo-contract - stat $(which cargo-contract) From e1b2b29519cb9c6419035da675589daf306fa86e Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 26 Nov 2019 13:24:32 +0100 Subject: [PATCH 12/24] build contract from it's repo --- .gitlab-ci.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fd6db618ea..92c502eb27 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -78,16 +78,17 @@ check-wasm: build-cli: stage: check <<: *docker-env + variables: + GIT_STRATEGY: none script: - - cargo install --git https://github.com/paritytech/cargo-contract --force - # - git clone --depth 1 https://github.com/paritytech/cargo-contract - # - pushd cargo-contract - # - cargo build --manifest-path cli/Cargo.toml --release - # - popd - # - ./target/release/cargo-contract -V - - which cargo-contract + # - cargo install --git https://github.com/paritytech/cargo-contract --force + - git clone --depth 1 https://github.com/paritytech/cargo-contract.git . + - cargo build --manifest-path cli/Cargo.toml --release + - ./target/release/cargo-contract -V + # - cargo contract -V + # - which cargo-contract - mkdir -p ./artifacts/ - - cp $(which cargo-contract) ./artifacts/ + - cp ./target/release/cargo-contract ./artifacts/ artifacts: name: cli_${CI_COMMIT_SHORT_SHA} expire_in: 24 hrs @@ -199,8 +200,8 @@ examples-contract-build: script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ - cp artifacts/cargo-contract /usr/local/cargo/bin/ - - which cargo-contract - - stat $(which cargo-contract) + # - which cargo-contract + # - stat $(which cargo-contract) - cargo contract -V - for example in examples/lang2/*; do pushd $example && @@ -218,8 +219,8 @@ examples-generate-metadata: script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ - cp artifacts/cargo-contract /usr/local/cargo/bin/ - - which cargo-contract - - stat $(which cargo-contract) + # - which cargo-contract + # - stat $(which cargo-contract) - cargo contract -V - for example in examples/lang2/*; do pushd $example && From 4ec37041ba8c9f63c9536b3ac51c744a0a6e52e0 Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 26 Nov 2019 13:26:03 +0100 Subject: [PATCH 13/24] typo --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 92c502eb27..e5b4ea002b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -79,7 +79,7 @@ build-cli: stage: check <<: *docker-env variables: - GIT_STRATEGY: none + GIT_STRATEGY: none script: # - cargo install --git https://github.com/paritytech/cargo-contract --force - git clone --depth 1 https://github.com/paritytech/cargo-contract.git . From d973450c6d0d2bf8757f367ef0b16f740a4ed204 Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 26 Nov 2019 13:51:31 +0100 Subject: [PATCH 14/24] fix build --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e5b4ea002b..9af0964b20 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -82,13 +82,13 @@ build-cli: GIT_STRATEGY: none script: # - cargo install --git https://github.com/paritytech/cargo-contract --force - - git clone --depth 1 https://github.com/paritytech/cargo-contract.git . - - cargo build --manifest-path cli/Cargo.toml --release - - ./target/release/cargo-contract -V + - git clone --depth 1 https://github.com/paritytech/cargo-contract.git + - cargo build --manifest-path cargo-contract/Cargo.toml --release + - ./cargo-contract/target/release/cargo-contract -V # - cargo contract -V # - which cargo-contract - mkdir -p ./artifacts/ - - cp ./target/release/cargo-contract ./artifacts/ + - cp ./cargo-contract/target/release/cargo-contract ./artifacts/ artifacts: name: cli_${CI_COMMIT_SHORT_SHA} expire_in: 24 hrs From 4ed97a27dcbc75ec3ea61747298fde91a9654b05 Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 26 Nov 2019 15:30:25 +0100 Subject: [PATCH 15/24] build won't work inside git repo. Install --root ftw --- .gitlab-ci.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9af0964b20..1d55f3bed2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,7 +14,6 @@ variables: GIT_STRATEGY: fetch GIT_DEPTH: "3" CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}" - SCCACHE_DIR: "/ci-cache/${CI_PROJECT_NAME}/sccache" CARGO_INCREMENTAL: 0 CI_SERVER_NAME: "GitLab CI" REGISTRY: registry.parity.io/parity/infrastructure/scripts @@ -81,20 +80,19 @@ build-cli: variables: GIT_STRATEGY: none script: - # - cargo install --git https://github.com/paritytech/cargo-contract --force - - git clone --depth 1 https://github.com/paritytech/cargo-contract.git - - cargo build --manifest-path cargo-contract/Cargo.toml --release - - ./cargo-contract/target/release/cargo-contract -V - # - cargo contract -V + - cargo install --git https://github.com/paritytech/cargo-contract --root /artifacts + # - git clone --depth 1 https://github.com/paritytech/cargo-contract.git + # - cargo build --manifest-path cargo-contract/Cargo.toml --release + - /artifacts/cargo contract -V # - which cargo-contract - - mkdir -p ./artifacts/ - - cp ./cargo-contract/target/release/cargo-contract ./artifacts/ + # - mkdir -p /artifacts/ + # - cp ./cargo-contract/target/release/cargo-contract /artifacts/ artifacts: name: cli_${CI_COMMIT_SHORT_SHA} expire_in: 24 hrs paths: # - ./target/release/cargo-contract - - artifacts/ + - /artifacts/ #### stage: workspace @@ -199,7 +197,7 @@ examples-contract-build: - build-cli script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ - - cp artifacts/cargo-contract /usr/local/cargo/bin/ + - cp /artifacts/cargo-contract /usr/local/cargo/bin/ # - which cargo-contract # - stat $(which cargo-contract) - cargo contract -V @@ -218,7 +216,7 @@ examples-generate-metadata: - build-cli script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ - - cp artifacts/cargo-contract /usr/local/cargo/bin/ + - cp /artifacts/cargo-contract /usr/local/cargo/bin/ # - which cargo-contract # - stat $(which cargo-contract) - cargo contract -V From d82e641d3fef0838d2dee373cdf9fc47093f9f7d Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 26 Nov 2019 15:56:59 +0100 Subject: [PATCH 16/24] fix build --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1d55f3bed2..0bded4626b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -83,7 +83,7 @@ build-cli: - cargo install --git https://github.com/paritytech/cargo-contract --root /artifacts # - git clone --depth 1 https://github.com/paritytech/cargo-contract.git # - cargo build --manifest-path cargo-contract/Cargo.toml --release - - /artifacts/cargo contract -V + - /artifacts/bin/cargo-contract -V # - which cargo-contract # - mkdir -p /artifacts/ # - cp ./cargo-contract/target/release/cargo-contract /artifacts/ @@ -197,7 +197,7 @@ examples-contract-build: - build-cli script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ - - cp /artifacts/cargo-contract /usr/local/cargo/bin/ + - cp /artifacts/bin/cargo-contract /usr/local/cargo/bin/ # - which cargo-contract # - stat $(which cargo-contract) - cargo contract -V @@ -216,7 +216,7 @@ examples-generate-metadata: - build-cli script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ - - cp /artifacts/cargo-contract /usr/local/cargo/bin/ + - cp /artifacts/bin/cargo-contract /usr/local/cargo/bin/ # - which cargo-contract # - stat $(which cargo-contract) - cargo contract -V From f35d19477cbc0f972ed25aeb678a40ec09af43e0 Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 26 Nov 2019 16:22:25 +0100 Subject: [PATCH 17/24] fix build n --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0bded4626b..fa0ba65198 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -92,7 +92,7 @@ build-cli: expire_in: 24 hrs paths: # - ./target/release/cargo-contract - - /artifacts/ + - /artifacts/bin/cargo-contract #### stage: workspace From c58963d6eada45c11f1086578d7e0312f3bbb600 Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 26 Nov 2019 16:40:32 +0100 Subject: [PATCH 18/24] fix artifacts --- .gitlab-ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fa0ba65198..ae37b3bf60 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -80,10 +80,10 @@ build-cli: variables: GIT_STRATEGY: none script: - - cargo install --git https://github.com/paritytech/cargo-contract --root /artifacts + - cargo install --git https://github.com/paritytech/cargo-contract --root ./artifacts # - git clone --depth 1 https://github.com/paritytech/cargo-contract.git # - cargo build --manifest-path cargo-contract/Cargo.toml --release - - /artifacts/bin/cargo-contract -V + - ./artifacts/bin/cargo-contract -V # - which cargo-contract # - mkdir -p /artifacts/ # - cp ./cargo-contract/target/release/cargo-contract /artifacts/ @@ -92,7 +92,7 @@ build-cli: expire_in: 24 hrs paths: # - ./target/release/cargo-contract - - /artifacts/bin/cargo-contract + - ./artifacts/bin/cargo-contract #### stage: workspace @@ -197,7 +197,7 @@ examples-contract-build: - build-cli script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ - - cp /artifacts/bin/cargo-contract /usr/local/cargo/bin/ + - cp ./artifacts/bin/cargo-contract /usr/local/cargo/bin/ # - which cargo-contract # - stat $(which cargo-contract) - cargo contract -V @@ -216,7 +216,7 @@ examples-generate-metadata: - build-cli script: # - cp target/release/cargo-contract /usr/local/cargo/bin/ - - cp /artifacts/bin/cargo-contract /usr/local/cargo/bin/ + - cp ./artifacts/bin/cargo-contract /usr/local/cargo/bin/ # - which cargo-contract # - stat $(which cargo-contract) - cargo contract -V From 9535bf7e9efd0d373dfb60d15a0cfdacdbf19193 Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 26 Nov 2019 16:53:41 +0100 Subject: [PATCH 19/24] cleanup and ready to go --- .gitlab-ci.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ae37b3bf60..cbb2c187d6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -81,17 +81,11 @@ build-cli: GIT_STRATEGY: none script: - cargo install --git https://github.com/paritytech/cargo-contract --root ./artifacts - # - git clone --depth 1 https://github.com/paritytech/cargo-contract.git - # - cargo build --manifest-path cargo-contract/Cargo.toml --release - ./artifacts/bin/cargo-contract -V - # - which cargo-contract - # - mkdir -p /artifacts/ - # - cp ./cargo-contract/target/release/cargo-contract /artifacts/ artifacts: name: cli_${CI_COMMIT_SHORT_SHA} expire_in: 24 hrs paths: - # - ./target/release/cargo-contract - ./artifacts/bin/cargo-contract @@ -196,10 +190,7 @@ examples-contract-build: needs: - build-cli script: - # - cp target/release/cargo-contract /usr/local/cargo/bin/ - cp ./artifacts/bin/cargo-contract /usr/local/cargo/bin/ - # - which cargo-contract - # - stat $(which cargo-contract) - cargo contract -V - for example in examples/lang2/*; do pushd $example && @@ -215,10 +206,7 @@ examples-generate-metadata: needs: - build-cli script: - # - cp target/release/cargo-contract /usr/local/cargo/bin/ - cp ./artifacts/bin/cargo-contract /usr/local/cargo/bin/ - # - which cargo-contract - # - stat $(which cargo-contract) - cargo contract -V - for example in examples/lang2/*; do pushd $example && From 6a251ba6d9aa11eddc43ca2268c44d3a5f357994 Mon Sep 17 00:00:00 2001 From: Denis P Date: Thu, 28 Nov 2019 11:37:35 +0100 Subject: [PATCH 20/24] contract is returned to dockerfile --- .gitlab-ci.yml | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cbb2c187d6..48caa4f06d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -74,20 +74,6 @@ check-wasm: cargo check --verbose --no-default-features --target wasm32-unknown-unknown --manifest-path ${crate}/Cargo.toml; done -build-cli: - stage: check - <<: *docker-env - variables: - GIT_STRATEGY: none - script: - - cargo install --git https://github.com/paritytech/cargo-contract --root ./artifacts - - ./artifacts/bin/cargo-contract -V - artifacts: - name: cli_${CI_COMMIT_SHORT_SHA} - expire_in: 24 hrs - paths: - - ./artifacts/bin/cargo-contract - #### stage: workspace @@ -185,12 +171,8 @@ examples-clippy-wasm: examples-contract-build: stage: examples <<: *docker-env - dependencies: - - build-cli - needs: - - build-cli script: - - cp ./artifacts/bin/cargo-contract /usr/local/cargo/bin/ + - cargo install --git https://github.com/paritytech/cargo-contract - cargo contract -V - for example in examples/lang2/*; do pushd $example && @@ -201,12 +183,8 @@ examples-contract-build: examples-generate-metadata: stage: examples <<: *docker-env - dependencies: - - build-cli - needs: - - build-cli script: - - cp ./artifacts/bin/cargo-contract /usr/local/cargo/bin/ + - cargo install --git https://github.com/paritytech/cargo-contract - cargo contract -V - for example in examples/lang2/*; do pushd $example && From 9bb069f88fde236f5262d63c2764580c0290d1ed Mon Sep 17 00:00:00 2001 From: Denis P Date: Thu, 28 Nov 2019 19:25:35 +0100 Subject: [PATCH 21/24] cargo install should have not given error when version matches --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 48caa4f06d..b94a0e6259 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -172,7 +172,7 @@ examples-contract-build: stage: examples <<: *docker-env script: - - cargo install --git https://github.com/paritytech/cargo-contract + - cargo install --git https://github.com/paritytech/cargo-contract || echo $? - cargo contract -V - for example in examples/lang2/*; do pushd $example && @@ -184,7 +184,7 @@ examples-generate-metadata: stage: examples <<: *docker-env script: - - cargo install --git https://github.com/paritytech/cargo-contract + - cargo install --git https://github.com/paritytech/cargo-contract || echo $? - cargo contract -V - for example in examples/lang2/*; do pushd $example && From 9c2564dc2304e3afd44b5df8544ffa81bb38b35d Mon Sep 17 00:00:00 2001 From: Denis P Date: Thu, 28 Nov 2019 19:32:30 +0100 Subject: [PATCH 22/24] comment, anchor --- .gitlab-ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b94a0e6259..39631877bb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -136,6 +136,10 @@ fmt: #### stage: examples +.update-cargo-contract &update-cargo-contract + # `cargo install` returns an error if there is nothing to update, so have to supress it here temporarily + - cargo install --git https://github.com/paritytech/cargo-contract || echo $? + examples-test: stage: examples <<: *docker-env @@ -172,7 +176,7 @@ examples-contract-build: stage: examples <<: *docker-env script: - - cargo install --git https://github.com/paritytech/cargo-contract || echo $? + - *update-cargo-contract - cargo contract -V - for example in examples/lang2/*; do pushd $example && @@ -184,7 +188,7 @@ examples-generate-metadata: stage: examples <<: *docker-env script: - - cargo install --git https://github.com/paritytech/cargo-contract || echo $? + - *update-cargo-contract - cargo contract -V - for example in examples/lang2/*; do pushd $example && From bd6744ce8e6b7f04f691f3622bd2636e442389e0 Mon Sep 17 00:00:00 2001 From: Denis P Date: Thu, 28 Nov 2019 19:33:41 +0100 Subject: [PATCH 23/24] typo --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 39631877bb..846b83cce0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -136,7 +136,7 @@ fmt: #### stage: examples -.update-cargo-contract &update-cargo-contract +.update-cargo-contract: &update-cargo-contract # `cargo install` returns an error if there is nothing to update, so have to supress it here temporarily - cargo install --git https://github.com/paritytech/cargo-contract || echo $? From 67dcf5692ae606d5e5c14ebf249a46f67db4727a Mon Sep 17 00:00:00 2001 From: Denis P Date: Thu, 28 Nov 2019 20:50:25 +0100 Subject: [PATCH 24/24] less dupes --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 846b83cce0..3ad652d535 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -139,6 +139,7 @@ fmt: .update-cargo-contract: &update-cargo-contract # `cargo install` returns an error if there is nothing to update, so have to supress it here temporarily - cargo install --git https://github.com/paritytech/cargo-contract || echo $? + - cargo contract -V examples-test: stage: examples @@ -177,7 +178,6 @@ examples-contract-build: <<: *docker-env script: - *update-cargo-contract - - cargo contract -V - for example in examples/lang2/*; do pushd $example && cargo contract build && @@ -189,7 +189,6 @@ examples-generate-metadata: <<: *docker-env script: - *update-cargo-contract - - cargo contract -V - for example in examples/lang2/*; do pushd $example && cargo contract generate-metadata &&