From 4cbea6e9ff0376378f05ba8d8fd360e2a109e127 Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 25 Nov 2019 12:50:11 +0100 Subject: [PATCH 01/31] initial save state, need to experiment [ skip ci] --- .gitlab-ci.yml | 252 ++++++++++++++++++++++++------------------------- 1 file changed, 125 insertions(+), 127 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b38d447a06b..27c34cc739d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -55,135 +55,133 @@ variables: - linux-docker -#### stage: check - -check-std: - stage: check - <<: *docker-env - script: - - for crate in ${ALL_CRATES}; do - cargo check --verbose --all-features; - done - -check-wasm: - stage: check - <<: *docker-env - script: - - for crate in ${WASM_CRATES}; do - cargo check --verbose --no-default-features --target wasm32-unknown-unknown --manifest-path ${crate}/Cargo.toml; - done - -#### stage: workspace - -build-std: +# #### stage: check + +# check-std: +# stage: check +# <<: *docker-env +# script: +# - for crate in ${ALL_CRATES}; do +# cargo check --verbose --all-features; +# done + +# check-wasm: +# stage: check +# <<: *docker-env +# script: +# - for crate in ${WASM_CRATES}; do +# cargo check --verbose --no-default-features --target wasm32-unknown-unknown --manifest-path ${crate}/Cargo.toml; +# done + +# #### stage: workspace + +codecov: stage: workspace <<: *docker-env dependencies: - check-std script: - - for crate in ${ALL_CRATES}; do - cargo build --verbose --all-features --release; - done - -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; - done - -test: - stage: workspace - <<: *docker-env - dependencies: - - check-std - script: - - for crate in ${ALL_CRATES}; do - cargo test --verbose --all-features --release; - done - -clippy-std: - stage: workspace - <<: *docker-env - dependencies: - - check-std - script: - - for crate in ${ALL_CRATES}; do - cargo clippy --verbose --all-features -- -D warnings; - done - -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; - done - -fmt: - stage: workspace - <<: *docker-env - script: - - for crate in ${ALL_CRATES}; do - cargo fmt --verbose -- --check; - done - - -#### stage: examples - -examples-test: - stage: examples - <<: *docker-env - script: - - for example in examples/lang2/*; do - cargo test --verbose --manifest-path ${example}/Cargo.toml; - done - -examples-fmt: - stage: examples - <<: *docker-env - script: - - for example in examples/lang2/*; do - cargo fmt --verbose --manifest-path ${example}/Cargo.toml -- --check; - done - -examples-clippy-std: - stage: examples - <<: *docker-env - script: - - for example in examples/lang2/*; do - cargo clippy --verbose --manifest-path ${example}/Cargo.toml -- -D warnings; - done - -examples-clippy-wasm: - stage: examples - <<: *docker-env - script: - - for example in examples/lang2/*; do - cargo clippy --verbose --manifest-path ${example}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings; - done - -examples-contract-build: - stage: examples - <<: *docker-env - script: - - for example in examples/lang2/*; do - pushd $example && - cargo contract build && - popd; - done - -examples-generate-metadata: - stage: examples - <<: *docker-env - script: - - for example in examples/lang2/*; do - pushd $example && - cargo contract generate-metadata && - popd; - 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; +# done + +# test: +# stage: workspace +# <<: *docker-env +# dependencies: +# - check-std +# script: +# - for crate in ${ALL_CRATES}; do +# cargo test --verbose --all-features --release; +# done + +# clippy-std: +# stage: workspace +# <<: *docker-env +# dependencies: +# - check-std +# script: +# - for crate in ${ALL_CRATES}; do +# cargo clippy --verbose --all-features -- -D warnings; +# done + +# 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; +# done + +# fmt: +# stage: workspace +# <<: *docker-env +# script: +# - for crate in ${ALL_CRATES}; do +# cargo fmt --verbose -- --check; +# done + + +# #### stage: examples + +# examples-test: +# stage: examples +# <<: *docker-env +# script: +# - for example in examples/lang2/*; do +# cargo test --verbose --manifest-path ${example}/Cargo.toml; +# done + +# examples-fmt: +# stage: examples +# <<: *docker-env +# script: +# - for example in examples/lang2/*; do +# cargo fmt --verbose --manifest-path ${example}/Cargo.toml -- --check; +# done + +# examples-clippy-std: +# stage: examples +# <<: *docker-env +# script: +# - for example in examples/lang2/*; do +# cargo clippy --verbose --manifest-path ${example}/Cargo.toml -- -D warnings; +# done + +# examples-clippy-wasm: +# stage: examples +# <<: *docker-env +# script: +# - for example in examples/lang2/*; do +# cargo clippy --verbose --manifest-path ${example}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings; +# done + +# examples-contract-build: +# stage: examples +# <<: *docker-env +# script: +# - for example in examples/lang2/*; do +# pushd $example && +# cargo contract build && +# popd; +# done + +# examples-generate-metadata: +# stage: examples +# <<: *docker-env +# script: +# - for example in examples/lang2/*; do +# pushd $example && +# cargo contract generate-metadata && +# popd; +# done From 9f1553b441aed7912292c3f0846052a49a14cb5a Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 7 Feb 2020 20:58:04 +0100 Subject: [PATCH 02/31] try config --- .gitlab-ci.yml | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 12f4537a835..8682bfabadc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -81,8 +81,29 @@ codecov: <<: *docker-env # dependencies: # - check-std + variables: + CARGO_INCREMENTAL: 0 + RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads' script: - - cargo build --verbose --all-features --release; + # - for crate in ${ALL_CRATES}; do + # cargo test --verbose --all-features --no-fail-fast --release --manifest-path ${crate}/Cargo.toml; + # done + - cargo clean + - for crate in core alloc prelude primitives lang lang/macro; do + cargo test --verbose --all-features --release --manifest-path ${crate}/Cargo.toml; + done + - apt install zip + - zip -0 ccov.zip `find /ci-cache/ \( -iname "*ink*.gc*" \) -print`; + - grcov ccov.zip -t coveralls --token ${CODECOV_TOKEN} --commit-sha $(git rev-parse HEAD) > ccov.json + - curl -X POST \ + --data-binary ccov.json \ + "https://codecov.io/upload/v2? \ + commit=$(git rev-parse HEAD)& \ + token=${CODECOV_TOKEN}& \ + build_url=https://example.com \ + &name=hui \ + &service=gitlab \ + &pr=1" # #### stage: workspace @@ -112,9 +133,7 @@ codecov: # needs: # - check-std # script: -# - for crate in ${ALL_CRATES}; do -# cargo test --verbose --all-features --release --manifest-path ${crate}/Cargo.toml; -# done +# - for crate in ${ALL_CRATES}; do cargo test --verbose --all-features --release --manifest-path ${crate}/Cargo.toml; done # clippy-std: # stage: workspace From e0f235dc55b63dda959c1912f8880fc213e3e4a2 Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 7 Feb 2020 21:07:30 +0100 Subject: [PATCH 03/31] more vars --- .gitlab-ci.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8682bfabadc..a8f9f7b558e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -89,21 +89,20 @@ codecov: # cargo test --verbose --all-features --no-fail-fast --release --manifest-path ${crate}/Cargo.toml; # done - cargo clean - - for crate in core alloc prelude primitives lang lang/macro; do + - for crate in ${ALL_CRATES}; do cargo test --verbose --all-features --release --manifest-path ${crate}/Cargo.toml; done - - apt install zip - - zip -0 ccov.zip `find /ci-cache/ \( -iname "*ink*.gc*" \) -print`; - - grcov ccov.zip -t coveralls --token ${CODECOV_TOKEN} --commit-sha $(git rev-parse HEAD) > ccov.json + - apt update && apt install -y zip + - zip -0 ccov.zip `find ${CARGO_TARGET_DIR} \( -iname "*ink*.gc*" \) -print`; + - grcov ccov.zip -t coveralls --token ${CODECOV_TOKEN} --commit-sha ${CI_COMMIT_SHA} > ccov.json - curl -X POST \ --data-binary ccov.json \ "https://codecov.io/upload/v2? \ - commit=$(git rev-parse HEAD)& \ + commit=${CI_COMMIT_SHORT_SHA}& \ token=${CODECOV_TOKEN}& \ - build_url=https://example.com \ - &name=hui \ + build_url=${CI_JOB_URL} \ &service=gitlab \ - &pr=1" + &pr=${CI_COMMIT_REF_NAME}" # #### stage: workspace From 5d96b5cde005583cf0d94d2f415929ce67529340 Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 7 Feb 2020 21:44:28 +0100 Subject: [PATCH 04/31] not that long URL --- .gitlab-ci.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a8f9f7b558e..01d0813fed3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -97,12 +97,8 @@ codecov: - grcov ccov.zip -t coveralls --token ${CODECOV_TOKEN} --commit-sha ${CI_COMMIT_SHA} > ccov.json - curl -X POST \ --data-binary ccov.json \ - "https://codecov.io/upload/v2? \ - commit=${CI_COMMIT_SHORT_SHA}& \ - token=${CODECOV_TOKEN}& \ - build_url=${CI_JOB_URL} \ - &service=gitlab \ - &pr=${CI_COMMIT_REF_NAME}" + "https://codecov.io/upload/v2? + commit=${CI_COMMIT_SHORT_SHA}&token=${CODECOV_TOKEN}&build_url=${CI_JOB_URL}&service=gitlab&pr=${CI_COMMIT_REF_NAME}" # #### stage: workspace From 8b9313447ef2c64eb7d3d40f7d85a17e11062bca Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 7 Feb 2020 21:49:57 +0100 Subject: [PATCH 05/31] json is not a host --- .gitlab-ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 01d0813fed3..7ecbcdecb96 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -95,10 +95,8 @@ codecov: - apt update && apt install -y zip - zip -0 ccov.zip `find ${CARGO_TARGET_DIR} \( -iname "*ink*.gc*" \) -print`; - grcov ccov.zip -t coveralls --token ${CODECOV_TOKEN} --commit-sha ${CI_COMMIT_SHA} > ccov.json - - curl -X POST \ - --data-binary ccov.json \ - "https://codecov.io/upload/v2? - commit=${CI_COMMIT_SHORT_SHA}&token=${CODECOV_TOKEN}&build_url=${CI_JOB_URL}&service=gitlab&pr=${CI_COMMIT_REF_NAME}" + - cat ccov.json + - curl -X POST --data-binary ccov.json "https://codecov.io/upload/v2?commit=${CI_COMMIT_SHORT_SHA}&token=${CODECOV_TOKEN}&build_url=${CI_JOB_URL}&service=gitlab&pr=${CI_COMMIT_REF_NAME}" # #### stage: workspace From 89d20d21f7606206481251f9f8c1deb334f9f4ec Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 7 Feb 2020 22:09:27 +0100 Subject: [PATCH 06/31] travis has to go --- .gitlab-ci.yml | 2 +- .travis.yml | 59 -------------------------------------------------- 2 files changed, 1 insertion(+), 60 deletions(-) delete mode 100644 .travis.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7ecbcdecb96..f767f13a5d8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -94,7 +94,7 @@ codecov: done - apt update && apt install -y zip - zip -0 ccov.zip `find ${CARGO_TARGET_DIR} \( -iname "*ink*.gc*" \) -print`; - - grcov ccov.zip -t coveralls --token ${CODECOV_TOKEN} --commit-sha ${CI_COMMIT_SHA} > ccov.json + - grcov ccov.zip -t coveralls+ --llvm --token ${CODECOV_TOKEN} --commit-sha ${CI_COMMIT_SHA} > ccov.json - cat ccov.json - curl -X POST --data-binary ccov.json "https://codecov.io/upload/v2?commit=${CI_COMMIT_SHORT_SHA}&token=${CODECOV_TOKEN}&build_url=${CI_JOB_URL}&service=gitlab&pr=${CI_COMMIT_REF_NAME}" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4d28fa7228c..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,59 +0,0 @@ -language: rust -cache: cargo -dist: trusty -sudo: true - -rust: - - nightly-2019-11-17 - -matrix: - allow_failures: - - rust: nightly - -env: - global: - - RUSTFLAGS="-C link-dead-code" - -addons: - apt: - packages: - - libcurl4-openssl-dev - - libelf-dev - - libdw-dev - - binutils-dev - - libiberty-dev - - g++ - - cmake - - zlib1g-dev - -install: - # Print rustc and cargo versions - - rustc -vV - - cargo -vV - - bash --version - # Install cargo-kcov Cargo plugin - - cargo install --force cargo-kcov - - cargo kcov -vV - # Install kcov binary - - wget https://github.com/SimonKagstrom/kcov/archive/v36.tar.gz - - tar xzf v36.tar.gz - - pushd kcov-36 - - mkdir build - - pushd build - - cmake .. - - make - - sudo make install # Puts kcov in the default location usually /usr/local/bin/kcov - - kcov --version - - popd - - popd - # Export cargo binaries, python and misc settings - - export PATH=$HOME/.local/bin:$HOME/.cargo/bin:$HOME/Library/Python/2.7/bin:$PATH - # Print current work directory state as directions. - - ls -lah - -script: -- | - cargo test --all-features --all - cargo kcov --verbose --coveralls --all --no-clean-rebuild - bash <(curl -s https://codecov.io/bash) - exit 0 From 2870188b108252c0feb65a99fe9c6fc2bf67524d Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 7 Feb 2020 23:46:43 +0100 Subject: [PATCH 07/31] canonic way of reporting --- .gitlab-ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f767f13a5d8..220d1e74104 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -93,10 +93,12 @@ codecov: cargo test --verbose --all-features --release --manifest-path ${crate}/Cargo.toml; done - apt update && apt install -y zip - - zip -0 ccov.zip `find ${CARGO_TARGET_DIR} \( -iname "*ink*.gc*" \) -print`; - - grcov ccov.zip -t coveralls+ --llvm --token ${CODECOV_TOKEN} --commit-sha ${CI_COMMIT_SHA} > ccov.json - - cat ccov.json - - curl -X POST --data-binary ccov.json "https://codecov.io/upload/v2?commit=${CI_COMMIT_SHORT_SHA}&token=${CODECOV_TOKEN}&build_url=${CI_JOB_URL}&service=gitlab&pr=${CI_COMMIT_REF_NAME}" + - zip -0 ccov.zip `find ${CARGO_TARGET_DIR} \( -iname "*.gc*" \) -print`; + # - grcov ccov.zip -t coveralls+ --llvm --token ${CODECOV_TOKEN} --commit-sha ${CI_COMMIT_SHA} > ccov.json + # - curl -X POST --data-binary ccov.json "https://codecov.io/upload/v2?commit=${CI_COMMIT_SHORT_SHA}&token=${CODECOV_TOKEN}&build_url=${CI_JOB_URL}&service=gitlab&pr=${CI_COMMIT_REF_NAME}" + # - bash <(curl https://codecov.io/bash) -t ${CODECOV_TOKEN} -f file -s ccov_reports + - grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" > lcov.info + - bash <(curl -s https://codecov.io/bash) -t ${CODECOV_TOKEN} -f lcov.info # #### stage: workspace From 38b3013ab4b5b754502bea38cc1af2f264117bcf Mon Sep 17 00:00:00 2001 From: Denis P Date: Sat, 8 Feb 2020 00:43:04 +0100 Subject: [PATCH 08/31] coveralls+ way of reporting --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 220d1e74104..ae56d2d7c4b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -94,11 +94,11 @@ codecov: done - apt update && apt install -y zip - zip -0 ccov.zip `find ${CARGO_TARGET_DIR} \( -iname "*.gc*" \) -print`; - # - grcov ccov.zip -t coveralls+ --llvm --token ${CODECOV_TOKEN} --commit-sha ${CI_COMMIT_SHA} > ccov.json + - grcov ccov.zip -t coveralls+ --llvm --token ${CODECOV_TOKEN} --commit-sha ${CI_COMMIT_SHA} > ccov.json # - curl -X POST --data-binary ccov.json "https://codecov.io/upload/v2?commit=${CI_COMMIT_SHORT_SHA}&token=${CODECOV_TOKEN}&build_url=${CI_JOB_URL}&service=gitlab&pr=${CI_COMMIT_REF_NAME}" # - bash <(curl https://codecov.io/bash) -t ${CODECOV_TOKEN} -f file -s ccov_reports - - grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" > lcov.info - - bash <(curl -s https://codecov.io/bash) -t ${CODECOV_TOKEN} -f lcov.info + # - grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" > lcov.info + - bash <(curl -s https://codecov.io/bash) -t ${CODECOV_TOKEN} -X gcov -f ccov.json # #### stage: workspace From d069811f2851aed14090829e38108eb639c91548 Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 18 Feb 2020 10:07:32 +0100 Subject: [PATCH 09/31] nightly explicitly --- .gitlab-ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ae56d2d7c4b..4d9cc0596f5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -85,13 +85,15 @@ codecov: CARGO_INCREMENTAL: 0 RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads' script: - # - for crate in ${ALL_CRATES}; do - # cargo test --verbose --all-features --no-fail-fast --release --manifest-path ${crate}/Cargo.toml; - # done - cargo clean - for crate in ${ALL_CRATES}; do - cargo test --verbose --all-features --release --manifest-path ${crate}/Cargo.toml; + cargo +nightly test --verbose --all-features --no-fail-fast --release --manifest-path ${crate}/Cargo.toml; done + # OR + # - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace + # OR with default members in manifest + # OR as in travis + # - cargo test --all-features --all - apt update && apt install -y zip - zip -0 ccov.zip `find ${CARGO_TARGET_DIR} \( -iname "*.gc*" \) -print`; - grcov ccov.zip -t coveralls+ --llvm --token ${CODECOV_TOKEN} --commit-sha ${CI_COMMIT_SHA} > ccov.json From e9756e1ecbf05e48b4e3177e734ba0ab5a16476c Mon Sep 17 00:00:00 2001 From: Denis P Date: Wed, 19 Feb 2020 15:24:16 +0100 Subject: [PATCH 10/31] tests with for cycle --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4d9cc0596f5..6c939752208 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -85,9 +85,9 @@ codecov: CARGO_INCREMENTAL: 0 RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads' script: - - cargo clean + # - cargo clean - for crate in ${ALL_CRATES}; do - cargo +nightly test --verbose --all-features --no-fail-fast --release --manifest-path ${crate}/Cargo.toml; + cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace; done # OR # - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace From 765a84e570845f4455f7879ac8411161ac1d2b72 Mon Sep 17 00:00:00 2001 From: Denis P Date: Wed, 19 Feb 2020 21:12:55 +0100 Subject: [PATCH 11/31] meant to compare coverages from loop and --workspace --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6c939752208..2c0ef120559 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -87,7 +87,7 @@ codecov: script: # - cargo clean - for crate in ${ALL_CRATES}; do - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace; + cargo +nightly test --verbose --all-features --no-fail-fast --release --manifest-path ${crate}/Cargo.toml;; done # OR # - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace From 7c5f228b418b1e89148059b1ff7caef6f8096a36 Mon Sep 17 00:00:00 2001 From: Denis Pisarev Date: Fri, 24 Apr 2020 16:51:56 +0200 Subject: [PATCH 12/31] Update .gitlab-ci.yml Co-Authored-By: Hero Bird --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2c0ef120559..05d439107e1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -87,7 +87,7 @@ codecov: script: # - cargo clean - for crate in ${ALL_CRATES}; do - cargo +nightly test --verbose --all-features --no-fail-fast --release --manifest-path ${crate}/Cargo.toml;; + cargo +nightly test --verbose --all-features --no-fail-fast --release --manifest-path ${crate}/Cargo.toml; done # OR # - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace From 3bebe7a742fb61bc3f4377ed8d592eebdb86389a Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 24 Apr 2020 17:33:49 +0200 Subject: [PATCH 13/31] test (ci): codecov with --workspace --- .gitlab-ci.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2c18d89bafd..c995cd05593 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -75,14 +75,12 @@ codecov: RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads' script: # - cargo clean - - for crate in ${ALL_CRATES}; do - cargo +nightly test --verbose --all-features --no-fail-fast --release --manifest-path ${crate}/Cargo.toml; - done + # - for crate in ${ALL_CRATES}; do + # cargo +nightly test --verbose --all-features --no-fail-fast --release --manifest-path ${crate}/Cargo.toml; + # done # OR - # - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace + - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace # OR with default members in manifest - # OR as in travis - # - cargo test --all-features --all - apt update && apt install -y zip - zip -0 ccov.zip `find ${CARGO_TARGET_DIR} \( -iname "*.gc*" \) -print`; - grcov ccov.zip -t coveralls+ --llvm --token ${CODECOV_TOKEN} --commit-sha ${CI_COMMIT_SHA} > ccov.json From f9d62b59d629fa5e1882cb197912347b88fd151c Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 27 Apr 2020 16:45:51 +0200 Subject: [PATCH 14/31] test (ci): --- .gitlab-ci.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c995cd05593..126ba8b515c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -68,19 +68,12 @@ variables: codecov: stage: check <<: *docker-env -# dependencies: -# - check-std variables: CARGO_INCREMENTAL: 0 RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads' script: - # - cargo clean - # - for crate in ${ALL_CRATES}; do - # cargo +nightly test --verbose --all-features --no-fail-fast --release --manifest-path ${crate}/Cargo.toml; - # done - # OR + - cargo clean; rm -rf $CARGO_TARGET_DIR - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace - # OR with default members in manifest - apt update && apt install -y zip - zip -0 ccov.zip `find ${CARGO_TARGET_DIR} \( -iname "*.gc*" \) -print`; - grcov ccov.zip -t coveralls+ --llvm --token ${CODECOV_TOKEN} --commit-sha ${CI_COMMIT_SHA} > ccov.json @@ -88,3 +81,14 @@ codecov: # - bash <(curl https://codecov.io/bash) -t ${CODECOV_TOKEN} -f file -s ccov_reports # - grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" > lcov.info - bash <(curl -s https://codecov.io/bash) -t ${CODECOV_TOKEN} -X gcov -f ccov.json + +test: + stage: check + <<: *docker-env + needs: + - check-std + script: + # - for crate in ${ALL_CRATES}; do + # cargo test --verbose --all-features --release --manifest-path ${crate}/Cargo.toml; + # done + - cargo test --verbose --all-features --release --workspace \ No newline at end of file From 7041c0a08e07f46562ff8b9368dfa02accdf1ba2 Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 27 Apr 2020 16:48:49 +0200 Subject: [PATCH 15/31] test (ci): comparing test runs --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 126ba8b515c..95d61811db7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -85,8 +85,8 @@ codecov: test: stage: check <<: *docker-env - needs: - - check-std + # needs: + # - check-std script: # - for crate in ${ALL_CRATES}; do # cargo test --verbose --all-features --release --manifest-path ${crate}/Cargo.toml; From c21f4c63542d231352ebc9866002efe94241312d Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 27 Apr 2020 17:08:34 +0200 Subject: [PATCH 16/31] test (ci): old hack conflicts with a new one --- .gitlab-ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 95d61811db7..3fb414a4559 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,6 @@ variables: CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}" CI_SERVER_NAME: "GitLab CI" REGISTRY: registry.parity.io/parity/infrastructure/scripts - ALL_CRATES: "core alloc prelude primitives lang lang/macro" .collect-artifacts: &collect-artifacts artifacts: @@ -37,7 +36,7 @@ variables: - bash --version - mkdir -p ${CARGO_HOME}; touch ${CARGO_HOME}/config # global RUSTFLAGS overrides the linker args so this way is better to pass the flags - - printf '[build]\nrustflags = ["-C", "link-dead-code"]\n' | tee ${CARGO_HOME}/config + # - printf '[build]\nrustflags = ["-C", "link-dead-code"]\n' | tee ${CARGO_HOME}/config # if there is no directory for this $CI_COMMIT_REF_NAME/$CI_JOB_NAME # create such directory and # create hardlinks recursively of all the files from the master/$CI_JOB_NAME if it exists @@ -63,17 +62,18 @@ variables: - unknown_failure - api_failure tags: - - linux-docker + - k2 codecov: stage: check <<: *docker-env variables: CARGO_INCREMENTAL: 0 - RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads' + RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads" script: - cargo clean; rm -rf $CARGO_TARGET_DIR - - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace + # - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace + - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace | tee output_workspace.log - apt update && apt install -y zip - zip -0 ccov.zip `find ${CARGO_TARGET_DIR} \( -iname "*.gc*" \) -print`; - grcov ccov.zip -t coveralls+ --llvm --token ${CODECOV_TOKEN} --commit-sha ${CI_COMMIT_SHA} > ccov.json From dccf7f18e53ad7f0e517b42227173adde723ba04 Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 27 Apr 2020 20:50:10 +0200 Subject: [PATCH 17/31] test (ci): -Zno-landing-pads caused test failures --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3fb414a4559..0a38772c22f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -69,7 +69,7 @@ codecov: <<: *docker-env variables: CARGO_INCREMENTAL: 0 - RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zno-landing-pads" + RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" script: - cargo clean; rm -rf $CARGO_TARGET_DIR # - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace From e02615867832f46140e4f70f22b7a76ecd1ab9e5 Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 28 Apr 2020 10:56:03 +0200 Subject: [PATCH 18/31] test (ci): try with cache --- .gitlab-ci.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0a38772c22f..70d74cc8ec4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -71,16 +71,14 @@ codecov: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" script: - - cargo clean; rm -rf $CARGO_TARGET_DIR - # - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace - - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace | tee output_workspace.log + - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace - apt update && apt install -y zip - - zip -0 ccov.zip `find ${CARGO_TARGET_DIR} \( -iname "*.gc*" \) -print`; - - grcov ccov.zip -t coveralls+ --llvm --token ${CODECOV_TOKEN} --commit-sha ${CI_COMMIT_SHA} > ccov.json + - zip -0 ccov.zip $(find "${CARGO_TARGET_DIR}" \( -iname "*.gc*" \) -print) + - grcov ccov.zip -t coveralls+ --llvm --token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" > ccov.json # - curl -X POST --data-binary ccov.json "https://codecov.io/upload/v2?commit=${CI_COMMIT_SHORT_SHA}&token=${CODECOV_TOKEN}&build_url=${CI_JOB_URL}&service=gitlab&pr=${CI_COMMIT_REF_NAME}" # - bash <(curl https://codecov.io/bash) -t ${CODECOV_TOKEN} -f file -s ccov_reports # - grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" > lcov.info - - bash <(curl -s https://codecov.io/bash) -t ${CODECOV_TOKEN} -X gcov -f ccov.json + - bash <(curl -s https://codecov.io/bash) -t "$CODECOV_TOKEN" -X gcov -f ccov.json test: stage: check From 467eee42568bf2316255869aa8749e6a6dc693d7 Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 28 Apr 2020 11:05:35 +0200 Subject: [PATCH 19/31] test (ci): no cache and zip with tar --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 70d74cc8ec4..0e440ca3d3a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -71,9 +71,11 @@ codecov: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" script: + - cargo clean - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace - - apt update && apt install -y zip - - zip -0 ccov.zip $(find "${CARGO_TARGET_DIR}" \( -iname "*.gc*" \) -print) + # - apt update && apt install -y zip + # - zip -0 ccov.zip $(find "${CARGO_TARGET_DIR}" \( -iname "*.gc*" \) -print) + - tar -cZf ccov.zip $(find "${CARGO_TARGET_DIR}" \( -iname "*.gc*" \) -print) - grcov ccov.zip -t coveralls+ --llvm --token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" > ccov.json # - curl -X POST --data-binary ccov.json "https://codecov.io/upload/v2?commit=${CI_COMMIT_SHORT_SHA}&token=${CODECOV_TOKEN}&build_url=${CI_JOB_URL}&service=gitlab&pr=${CI_COMMIT_REF_NAME}" # - bash <(curl https://codecov.io/bash) -t ${CODECOV_TOKEN} -f file -s ccov_reports From 55803f2503bbe5f263d76428f42be280af5dad17 Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 28 Apr 2020 11:16:46 +0200 Subject: [PATCH 20/31] test (ci): return to zip --- .gitlab-ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0e440ca3d3a..a325b8d7ae5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -73,9 +73,8 @@ codecov: script: - cargo clean - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace - # - apt update && apt install -y zip - # - zip -0 ccov.zip $(find "${CARGO_TARGET_DIR}" \( -iname "*.gc*" \) -print) - - tar -cZf ccov.zip $(find "${CARGO_TARGET_DIR}" \( -iname "*.gc*" \) -print) + - apt update && apt install -y zip + - zip -0 ccov.zip $(find "${CARGO_TARGET_DIR}" \( -iname "*.gc*" \) -print) - grcov ccov.zip -t coveralls+ --llvm --token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" > ccov.json # - curl -X POST --data-binary ccov.json "https://codecov.io/upload/v2?commit=${CI_COMMIT_SHORT_SHA}&token=${CODECOV_TOKEN}&build_url=${CI_JOB_URL}&service=gitlab&pr=${CI_COMMIT_REF_NAME}" # - bash <(curl https://codecov.io/bash) -t ${CODECOV_TOKEN} -f file -s ccov_reports From e816bccfc8e1b7d489568b925c201d658780676a Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 28 Apr 2020 12:41:19 +0200 Subject: [PATCH 21/31] test (ci): no target caching, no release --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a325b8d7ae5..8646d540642 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -71,10 +71,12 @@ codecov: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" script: + - unset CARGO_TARGET_DIR - cargo clean - - cargo +nightly test --verbose --all-features --no-fail-fast --release --workspace + - cargo +nightly test --verbose --all-features --no-fail-fast --workspace - apt update && apt install -y zip - - zip -0 ccov.zip $(find "${CARGO_TARGET_DIR}" \( -iname "*.gc*" \) -print) + # - zip -0 ccov.zip $(find "${CARGO_TARGET_DIR}" \( -iname "*.gc*" \) -print) + - zip -0 ccov.zip $(find ./target \( -iname "*.gc*" \) -print) - grcov ccov.zip -t coveralls+ --llvm --token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" > ccov.json # - curl -X POST --data-binary ccov.json "https://codecov.io/upload/v2?commit=${CI_COMMIT_SHORT_SHA}&token=${CODECOV_TOKEN}&build_url=${CI_JOB_URL}&service=gitlab&pr=${CI_COMMIT_REF_NAME}" # - bash <(curl https://codecov.io/bash) -t ${CODECOV_TOKEN} -f file -s ccov_reports From d6fb06d0280cd8d97acf766c5166ee205ddf657b Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 28 Apr 2020 17:46:36 +0200 Subject: [PATCH 22/31] test (ci): better report --- .gitlab-ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8646d540642..8f8798ba45f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -71,13 +71,14 @@ codecov: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" script: - - unset CARGO_TARGET_DIR + # - unset CARGO_TARGET_DIR - cargo clean - - cargo +nightly test --verbose --all-features --no-fail-fast --workspace - - apt update && apt install -y zip + - cargo test --verbose --all-features --no-fail-fast --workspace + - cargo build --verbose --all-features --workspace + # - apt update && apt install -y zip # - zip -0 ccov.zip $(find "${CARGO_TARGET_DIR}" \( -iname "*.gc*" \) -print) - - zip -0 ccov.zip $(find ./target \( -iname "*.gc*" \) -print) - - grcov ccov.zip -t coveralls+ --llvm --token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" > ccov.json + # - grcov ccov.zip -t coveralls+ --llvm --token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" > ccov.json + - grcov /ci-cache/target/ -s . -t coveralls+ --llvm --branch --ignore-not-existing --ignore "/*" --token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" > ccov.json # - curl -X POST --data-binary ccov.json "https://codecov.io/upload/v2?commit=${CI_COMMIT_SHORT_SHA}&token=${CODECOV_TOKEN}&build_url=${CI_JOB_URL}&service=gitlab&pr=${CI_COMMIT_REF_NAME}" # - bash <(curl https://codecov.io/bash) -t ${CODECOV_TOKEN} -f file -s ccov_reports # - grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" > lcov.info From 2167c55088932a984a5c54cbae065d947083af0d Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 28 Apr 2020 18:02:06 +0200 Subject: [PATCH 23/31] test (ci): target dir var, cleanup after --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8f8798ba45f..5be5fd9d6ee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -72,17 +72,19 @@ codecov: RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" script: # - unset CARGO_TARGET_DIR - - cargo clean + # - cargo clean - cargo test --verbose --all-features --no-fail-fast --workspace - cargo build --verbose --all-features --workspace # - apt update && apt install -y zip # - zip -0 ccov.zip $(find "${CARGO_TARGET_DIR}" \( -iname "*.gc*" \) -print) # - grcov ccov.zip -t coveralls+ --llvm --token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" > ccov.json - - grcov /ci-cache/target/ -s . -t coveralls+ --llvm --branch --ignore-not-existing --ignore "/*" --token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" > ccov.json + - grcov "${CARGO_TARGET_DIR}" -s . -t coveralls+ --llvm --branch --ignore-not-existing --ignore "/*" --token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" > ccov.json # - curl -X POST --data-binary ccov.json "https://codecov.io/upload/v2?commit=${CI_COMMIT_SHORT_SHA}&token=${CODECOV_TOKEN}&build_url=${CI_JOB_URL}&service=gitlab&pr=${CI_COMMIT_REF_NAME}" # - bash <(curl https://codecov.io/bash) -t ${CODECOV_TOKEN} -f file -s ccov_reports # - grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" > lcov.info - bash <(curl -s https://codecov.io/bash) -t "$CODECOV_TOKEN" -X gcov -f ccov.json + after_script: + - find "${CARGO_TARGET_DIR}" \( -iname "*.gc*" \) -delete test: stage: check From 84e452a2b08d8ca6a7ed5c26a17d61ed7e183615 Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 28 Apr 2020 19:36:14 +0200 Subject: [PATCH 24/31] test (ci): final version --- .gitlab-ci.yml | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5be5fd9d6ee..7b340145de0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -71,28 +71,10 @@ codecov: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" script: - # - unset CARGO_TARGET_DIR - # - cargo clean + - unset "CARGO_TARGET_DIR" + - cargo clean - cargo test --verbose --all-features --no-fail-fast --workspace - cargo build --verbose --all-features --workspace - # - apt update && apt install -y zip - # - zip -0 ccov.zip $(find "${CARGO_TARGET_DIR}" \( -iname "*.gc*" \) -print) - # - grcov ccov.zip -t coveralls+ --llvm --token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" > ccov.json - - grcov "${CARGO_TARGET_DIR}" -s . -t coveralls+ --llvm --branch --ignore-not-existing --ignore "/*" --token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" > ccov.json - # - curl -X POST --data-binary ccov.json "https://codecov.io/upload/v2?commit=${CI_COMMIT_SHORT_SHA}&token=${CODECOV_TOKEN}&build_url=${CI_JOB_URL}&service=gitlab&pr=${CI_COMMIT_REF_NAME}" - # - bash <(curl https://codecov.io/bash) -t ${CODECOV_TOKEN} -f file -s ccov_reports - # - grcov ccov.zip -s . -t lcov --llvm --branch --ignore-not-existing --ignore "/*" > lcov.info + - grcov ./target -s . -t coveralls+ --guess-directory-when-missing --llvm --branch --ignore-not-existing --ignore "/*" + --token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" --output-file ccov.json - bash <(curl -s https://codecov.io/bash) -t "$CODECOV_TOKEN" -X gcov -f ccov.json - after_script: - - find "${CARGO_TARGET_DIR}" \( -iname "*.gc*" \) -delete - -test: - stage: check - <<: *docker-env - # needs: - # - check-std - script: - # - for crate in ${ALL_CRATES}; do - # cargo test --verbose --all-features --release --manifest-path ${crate}/Cargo.toml; - # done - - cargo test --verbose --all-features --release --workspace \ No newline at end of file From 806364374ab425b9739ebf69fd73c259b65b6cc4 Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 28 Apr 2020 20:49:22 +0200 Subject: [PATCH 25/31] test (ci): restore CI config --- .gitlab-ci.yml | 195 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 190 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7b340145de0..5e37a787b10 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,15 +34,12 @@ variables: - rustc -vV - rustup show - bash --version - - mkdir -p ${CARGO_HOME}; touch ${CARGO_HOME}/config - # global RUSTFLAGS overrides the linker args so this way is better to pass the flags - # - printf '[build]\nrustflags = ["-C", "link-dead-code"]\n' | tee ${CARGO_HOME}/config # if there is no directory for this $CI_COMMIT_REF_NAME/$CI_JOB_NAME # create such directory and # create hardlinks recursively of all the files from the master/$CI_JOB_NAME if it exists - if [[ ! -d $CARGO_TARGET_DIR ]]; then mkdir -p /ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}; - cp -al /ci-cache/${CI_PROJECT_NAME}/targets/${CI_DEFAULT_BRANCH}/${CI_JOB_NAME} + cp -r /ci-cache/${CI_PROJECT_NAME}/targets/${CI_DEFAULT_BRANCH}/${CI_JOB_NAME} /ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME} || echo "_____No such target dir, proceeding from scratch_____"; fi @@ -64,17 +61,205 @@ variables: tags: - k2 -codecov: + +#### stage: check + +check-std: + stage: check + <<: *docker-env + script: + - for crate in ${ALL_CRATES}; do + cargo check --verbose --all-features --manifest-path ${crate}/Cargo.toml; + done + +check-wasm: stage: check <<: *docker-env + script: + - for crate in ${ALL_CRATES}; do + cargo check --verbose --no-default-features --target wasm32-unknown-unknown --manifest-path ${crate}/Cargo.toml; + done + + +#### stage: workspace + +build-std: + stage: workspace + <<: *docker-env + needs: + - check-std + script: + - for crate in ${ALL_CRATES}; do + cargo build --verbose --all-features --release --manifest-path ${crate}/Cargo.toml; + done + +build-wasm: + stage: workspace + <<: *docker-env + needs: + - check-wasm + script: + - for crate in ${ALL_CRATES}; do + cargo build --verbose --no-default-features --release --target wasm32-unknown-unknown --manifest-path ${crate}/Cargo.toml; + done + +test: + stage: workspace + <<: *docker-env + needs: + - check-std + script: + - cargo test --verbose --all-features --no-fail-fast --release --workspace + +codecov: + stage: workspace + <<: *docker-env + needs: + - check-std variables: + # according to https://github.com/mozilla/grcov/blob/master/README.md we have to use these variables, however CARGO_INCREMENTAL: 0 + # it does not work with -Zno-landing-pads RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" + # it's better to use `cargo-taurpalin` instead of `grcov`, but the former doesn't work within docker properly script: + # RUSTFLAGS are the cause target cache can't be used here - unset "CARGO_TARGET_DIR" - cargo clean - cargo test --verbose --all-features --no-fail-fast --workspace - cargo build --verbose --all-features --workspace - grcov ./target -s . -t coveralls+ --guess-directory-when-missing --llvm --branch --ignore-not-existing --ignore "/*" --token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" --output-file ccov.json + # this is a shame it's the only way to upload to codecov - bash <(curl -s https://codecov.io/bash) -t "$CODECOV_TOKEN" -X gcov -f ccov.json + +clippy-std: + stage: workspace + <<: *docker-env + needs: + - check-std + script: + - for crate in ${ALL_CRATES}; do + cargo clippy --verbose --all-features --manifest-path ${crate}/Cargo.toml -- -D warnings; + done + +clippy-wasm: + stage: workspace + <<: *docker-env + needs: + - check-wasm + script: + - for crate in ${ALL_CRATES}; do + cargo clippy --verbose --no-default-features --manifest-path ${crate}/Cargo.toml --target wasm32-unknown-unknown -- -D warnings; + done + +fmt: + stage: workspace + <<: *docker-env + script: + - cargo fmt --verbose --all -- --check + + +#### 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 cargo-contract || echo $? + - cargo contract -V + +examples-test: + stage: examples + <<: *docker-env + script: + - for example in examples/*/; do + cargo test --verbose --manifest-path ${example}/Cargo.toml; + done + +examples-fmt: + stage: examples + <<: *docker-env + script: + - for example in examples/*/; do + cargo fmt --verbose --manifest-path ${example}/Cargo.toml -- --check; + done + +examples-clippy-std: + stage: examples + <<: *docker-env + script: + - for example in examples/*/; do + cargo clippy --verbose --manifest-path ${example}/Cargo.toml -- -D warnings; + done + +examples-clippy-wasm: + stage: examples + <<: *docker-env + script: + - for example in examples/*/; do + cargo clippy --verbose --manifest-path ${example}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings; + done + +examples-contract-build: + stage: examples + <<: *docker-env + script: + - *update-cargo-contract + - for example in examples/*/; do + pushd $example && + cargo contract build && + popd; + done + +examples-generate-metadata: + stage: examples + <<: *docker-env + script: + - *update-cargo-contract + - for example in examples/*/; do + pushd $example && + cargo contract generate-metadata && + popd; + done + +#### stage: publish + +publish-docs: + stage: publish + <<: *docker-env + variables: + GIT_DEPTH: 0 + only: + - master + - schedules + - tags + script: + - rm -rf /tmp/* + - unset CARGO_TARGET_DIR + # Set git config + - rm .git/config + - git config user.email "devops-team@parity.io" + - git config user.name "${GITHUB_USER}" + - git config remote.origin.url "https://${GITHUB_TOKEN}@github.com/paritytech/ink.git" + - git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" + - git fetch origin gh-pages + # Generating Docs + - time cargo doc --no-deps --all-features + -p type-metadata -p ink_abi -p ink_abi_derive -p ink_core -p ink_core_derive + -p ink_primitives -p ink_prelude -p ink_lang -p ink_lang_macro + # saving README and docs + - mv target/doc/ /tmp/ + - cp README.md /tmp/doc/ + - git checkout gh-pages + - mv _config.yml /tmp/doc/ + # remove everything and restore generated docs, README and Jekyll config + - rm -rf ./* + - mv /tmp/doc/* . + # Upload files + - git add --all --force + - git status + - git commit -m "Updated docs for ${CI_COMMIT_REF_NAME} and pushed to gh-pages" + - git push origin gh-pages --force + after_script: + - rm -rf .git/ ./* + + From 0a3b17e3f2fd89d6e6ac5915d10b9e16a3a4f964 Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 28 Apr 2020 20:55:35 +0200 Subject: [PATCH 26/31] change (ci): code coverage with grcov -> coveralls --- .gitlab-ci.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5e37a787b10..3981bb70e06 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,6 +18,7 @@ variables: CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}" CI_SERVER_NAME: "GitLab CI" REGISTRY: registry.parity.io/parity/infrastructure/scripts + ALL_CRATES: "core alloc prelude primitives lang lang/macro" .collect-artifacts: &collect-artifacts artifacts: @@ -39,7 +40,7 @@ variables: # create hardlinks recursively of all the files from the master/$CI_JOB_NAME if it exists - if [[ ! -d $CARGO_TARGET_DIR ]]; then mkdir -p /ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}; - cp -r /ci-cache/${CI_PROJECT_NAME}/targets/${CI_DEFAULT_BRANCH}/${CI_JOB_NAME} + cp -al /ci-cache/${CI_PROJECT_NAME}/targets/${CI_DEFAULT_BRANCH}/${CI_JOB_NAME} /ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME} || echo "_____No such target dir, proceeding from scratch_____"; fi @@ -59,7 +60,7 @@ variables: - unknown_failure - api_failure tags: - - k2 + - linux-docker #### stage: check @@ -128,7 +129,7 @@ codecov: - cargo clean - cargo test --verbose --all-features --no-fail-fast --workspace - cargo build --verbose --all-features --workspace - - grcov ./target -s . -t coveralls+ --guess-directory-when-missing --llvm --branch --ignore-not-existing --ignore "/*" + - grcov ./target -s . -t coveralls+ --guess-directory-when-missing --llvm --branch --ignore-not-existing --ignore "/*" --token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" --output-file ccov.json # this is a shame it's the only way to upload to codecov - bash <(curl -s https://codecov.io/bash) -t "$CODECOV_TOKEN" -X gcov -f ccov.json @@ -233,13 +234,13 @@ publish-docs: - schedules - tags script: - - rm -rf /tmp/* - - unset CARGO_TARGET_DIR - # Set git config - - rm .git/config - - git config user.email "devops-team@parity.io" - - git config user.name "${GITHUB_USER}" - - git config remote.origin.url "https://${GITHUB_TOKEN}@github.com/paritytech/ink.git" + - rm -rf /tmp/* + - unset CARGO_TARGET_DIR + # Set git config + - rm .git/config + - git config user.email "devops-team@parity.io" + - git config user.name "${GITHUB_USER}" + - git config remote.origin.url "https://${GITHUB_TOKEN}@github.com/paritytech/ink.git" - git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" - git fetch origin gh-pages # Generating Docs @@ -261,5 +262,3 @@ publish-docs: - git push origin gh-pages --force after_script: - rm -rf .git/ ./* - - From 1503c88763eb77eea74d74c3e8208ff08b8a2a2f Mon Sep 17 00:00:00 2001 From: Denis Pisarev Date: Wed, 29 Apr 2020 08:43:57 +0200 Subject: [PATCH 27/31] doc (ci): cleaner comments --- .gitlab-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3981bb70e06..c1955107756 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -120,9 +120,10 @@ codecov: variables: # according to https://github.com/mozilla/grcov/blob/master/README.md we have to use these variables, however CARGO_INCREMENTAL: 0 - # it does not work with -Zno-landing-pads + # it `-Zno-landing-pads` fails some tests RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" - # it's better to use `cargo-taurpalin` instead of `grcov`, but the former doesn't work within docker properly + # it's better to use `cargo-taurpalin` instead of `grcov`, + # but the former requires running docker with `--security-opt seccomp=unconfined` script: # RUSTFLAGS are the cause target cache can't be used here - unset "CARGO_TARGET_DIR" @@ -131,7 +132,7 @@ codecov: - cargo build --verbose --all-features --workspace - grcov ./target -s . -t coveralls+ --guess-directory-when-missing --llvm --branch --ignore-not-existing --ignore "/*" --token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" --output-file ccov.json - # this is a shame it's the only way to upload to codecov + # this is a shame that running a huge online bash the only way to upload to codecov - bash <(curl -s https://codecov.io/bash) -t "$CODECOV_TOKEN" -X gcov -f ccov.json clippy-std: From bbd3e4fc9d7759bd639ae2bb772ac70c3761a22e Mon Sep 17 00:00:00 2001 From: Denis Pisarev Date: Wed, 29 Apr 2020 13:00:29 +0200 Subject: [PATCH 28/31] Update .gitlab-ci.yml Co-Authored-By: Hero Bird --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c1955107756..a0b8598f7db 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -120,7 +120,7 @@ codecov: variables: # according to https://github.com/mozilla/grcov/blob/master/README.md we have to use these variables, however CARGO_INCREMENTAL: 0 - # it `-Zno-landing-pads` fails some tests + # If `-Zno-landing-pads` is enabled some some tests start to fail. RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" # it's better to use `cargo-taurpalin` instead of `grcov`, # but the former requires running docker with `--security-opt seccomp=unconfined` From c19b5f7bf7be6d0c9daa655bbe899c8b58ad3701 Mon Sep 17 00:00:00 2001 From: Denis Pisarev Date: Wed, 29 Apr 2020 13:00:48 +0200 Subject: [PATCH 29/31] Update .gitlab-ci.yml Co-Authored-By: Hero Bird --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a0b8598f7db..97413809ed3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -118,7 +118,8 @@ codecov: needs: - check-std variables: - # according to https://github.com/mozilla/grcov/blob/master/README.md we have to use these variables, however + # According to https://github.com/mozilla/grcov/blob/master/README.md + # we have to use these variables. CARGO_INCREMENTAL: 0 # If `-Zno-landing-pads` is enabled some some tests start to fail. RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" From 92261cf3f830f6551c7a24a9c391124ebf44792b Mon Sep 17 00:00:00 2001 From: Denis Pisarev Date: Wed, 29 Apr 2020 13:01:24 +0200 Subject: [PATCH 30/31] Update .gitlab-ci.yml Co-Authored-By: Hero Bird --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 97413809ed3..8374a2ca67e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -123,8 +123,10 @@ codecov: CARGO_INCREMENTAL: 0 # If `-Zno-landing-pads` is enabled some some tests start to fail. RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off" - # it's better to use `cargo-taurpalin` instead of `grcov`, - # but the former requires running docker with `--security-opt seccomp=unconfined` + # The `cargo-taurpalin` coverage reporting tool seems to have better code instrumentation + # and thus produces better results for Rust codebases in general. However, unlike `grcov` it + # requires running docker with `--security-opt seccomp=unconfined` which is why we use `grcov` + # instead. script: # RUSTFLAGS are the cause target cache can't be used here - unset "CARGO_TARGET_DIR" From f3a70ad1ecf2f17553176259a644efee2b43783f Mon Sep 17 00:00:00 2001 From: Denis Pisarev Date: Wed, 29 Apr 2020 13:01:45 +0200 Subject: [PATCH 31/31] Update .gitlab-ci.yml Co-Authored-By: Hero Bird --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8374a2ca67e..3b4b9d552a9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -135,7 +135,8 @@ codecov: - cargo build --verbose --all-features --workspace - grcov ./target -s . -t coveralls+ --guess-directory-when-missing --llvm --branch --ignore-not-existing --ignore "/*" --token "$CODECOV_TOKEN" --commit-sha "$CI_COMMIT_SHA" --output-file ccov.json - # this is a shame that running a huge online bash the only way to upload to codecov + # We'd like to not use a remote bash script for uploading the coverage reports, + # however this job seems to be more tricky than we hoped. - bash <(curl -s https://codecov.io/bash) -t "$CODECOV_TOKEN" -X gcov -f ccov.json clippy-std: