Unverified Commit a15ec5b0 authored by Michael Müller's avatar Michael Müller
Browse files

Revert me: Remove all other stages

parent 312d9a5b
Pipeline #146506 passed with stage
in 8 seconds
......@@ -6,12 +6,7 @@
stages:
- check
- workspace
- examples
- ink-waterfall
- fuzz
- publish
variables:
GIT_STRATEGY: fetch
......@@ -66,288 +61,6 @@ workflow:
- linux-docker
#### stage: check
check-std:
stage: check
<<: *docker-env
script:
- for crate in ${ALL_CRATES}; do
cargo check --verbose --all-features --manifest-path crates/${crate}/Cargo.toml;
done
check-wasm:
stage: check
<<: *docker-env
script:
- for crate in ${ALSO_WASM_CRATES}; do
cargo check --verbose --no-default-features --target wasm32-unknown-unknown --manifest-path crates/${crate}/Cargo.toml;
done
#### stage: workspace
build-std:
stage: workspace
<<: *docker-env
needs:
- job: check-std
artifacts: false
script:
- for crate in ${ALL_CRATES}; do
cargo build --verbose --all-features --release --manifest-path crates/${crate}/Cargo.toml;
done
build-wasm:
stage: workspace
<<: *docker-env
needs:
- job: check-wasm
artifacts: false
script:
- for crate in ${ALSO_WASM_CRATES}; do
cargo build --verbose --no-default-features --release --target wasm32-unknown-unknown --manifest-path crates/${crate}/Cargo.toml;
done
test:
stage: workspace
<<: *docker-env
needs:
- job: check-std
artifacts: false
variables:
# Since we run the tests with `--all-features` this implies the feature
# `ink-fuzz-tests` as well -- i.e. the fuzz tests are run.
# There's no way to disable a single feature while enabling all features
# at the same time, hence we use this workaround.
QUICKCHECK_TESTS: 0
script:
- cargo test --verbose --all-features --no-fail-fast --workspace
- cargo test --verbose --all-features --no-fail-fast --workspace --doc
# Just needed as long as we have the `ink-experimental-engine` feature.
# We do not invoke `--all-features` here -- this would imply the feature
# `ink-experimental-engine`. So in order to still run the tests without the
# experimental engine feature we need this command.
- cargo test --verbose --features std --no-fail-fast --workspace
docs:
stage: workspace
<<: *docker-env
variables:
RUSTDOCFLAGS: -Dwarnings
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc"
when: on_success
expire_in: 7 days
paths:
- ./crate-docs/
script:
- cargo doc --no-deps --all-features
-p scale-info -p ink_metadata
-p ink_env -p ink_storage -p ink_storage_derive
-p ink_primitives -p ink_prelude
-p ink_lang -p ink_lang_macro -p ink_lang_ir -p ink_lang_codegen
- mv ${CARGO_TARGET_DIR}/doc ./crate-docs
spellcheck:
stage: workspace
<<: *docker-env
script:
- cargo spellcheck check -vvv --cfg=.config/cargo_spellcheck.toml --checkers hunspell --code 1
- for example in examples/*/; do
cargo spellcheck check -vvv --cfg=.config/cargo_spellcheck.toml --checkers hunspell --code 1 ${example};
done
- for contract in ${DELEGATOR_SUBCONTRACTS}; do
cargo spellcheck check -vvv --cfg=.config/cargo_spellcheck.toml --checkers hunspell --code 1 examples/delegator/${contract}/;
done
codecov:
stage: workspace
<<: *docker-env
needs:
- job: check-std
artifacts: false
variables:
# For codecov it's sufficient to run the fuzz tests only once.
QUICKCHECK_TESTS: 1
# Variables partly came from https://github.com/mozilla/grcov/blob/master/README.md
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Zprofile -Zmir-opt-level=0 -Ccodegen-units=1
-Copt-level=0 -Clink-dead-code -Coverflow-checks=off"
# 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.
before_script:
- cargo -vV
- rustc -vV
- rustup show
- bash --version
- unset "CARGO_TARGET_DIR"
- cargo clean
script:
# RUSTFLAGS are the cause target cache can't be used here
- cargo build --verbose --all-features --workspace
- cargo test --verbose --all-features --no-fail-fast --workspace
# Just needed as long as we have the `ink-experimental-engine` feature.
# We must additionally run the coverage without `--all-features` here -- this
# would imply the feature `ink-experimental-engine`. So in order to still run
# the tests without the experimental engine feature we need this command.
- cargo test --verbose --features std --no-fail-fast --workspace
# coverage with branches
- grcov . --source-dir . --output-type lcov --llvm --branch --ignore-not-existing
--ignore "/*" --ignore "tests/*" --output-path lcov-w-branch.info
- rust-covfix lcov-w-branch.info --output lcov-w-branch-fixed.info
# 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_P_TOKEN" -f lcov-w-branch-fixed.info
# lines coverage
- grcov . --source-dir . --output-type lcov --llvm --ignore-not-existing
--ignore "/*" --ignore "tests/*" --output-path lcov-lines.info
- rust-covfix lcov-lines.info --output lcov-lines-fixed.info
- bash <(curl -s https://codecov.io/bash) -f lcov-lines-fixed.info
clippy-std:
stage: workspace
<<: *docker-env
needs:
- job: check-std
artifacts: false
script:
- for crate in ${ALL_CRATES}; do
cargo clippy --verbose --all-features --manifest-path crates/${crate}/Cargo.toml -- -D warnings;
done
clippy-wasm:
stage: workspace
<<: *docker-env
needs:
- job: check-wasm
artifacts: false
script:
- for crate in ${ALSO_WASM_CRATES}; do
cargo clippy --verbose --no-default-features --manifest-path crates/${crate}/Cargo.toml --target wasm32-unknown-unknown -- -D warnings;
done
fmt:
stage: workspace
<<: *docker-env
script:
- cargo fmt --verbose --all -- --check
# For the UI tests we need to disable the license check
- cargo fmt --verbose --all -- --check --config=license_template_path="" crates/lang/macro/tests/ui/{pass,fail}/*.rs
#### stage: examples
examples-test:
stage: examples
<<: *docker-env
needs:
- job: clippy-std
artifacts: false
script:
- for example in examples/*/; do
cargo test --verbose --manifest-path ${example}/Cargo.toml;
done
- for contract in ${DELEGATOR_SUBCONTRACTS}; do
cargo test --verbose --manifest-path examples/delegator/${contract}/Cargo.toml;
done
examples-test-experimental-engine:
stage: examples
<<: *docker-env
needs:
- job: clippy-std
artifacts: false
script:
# We test only the examples for which the tests have already been migrated to
# use the experimental engine.
- cargo test --no-default-features --features std, ink-experimental-engine --verbose --manifest-path examples/erc20/Cargo.toml
- cargo test --no-default-features --features std, ink-experimental-engine --verbose --manifest-path examples/erc1155/Cargo.toml
- cargo test --no-default-features --features std, ink-experimental-engine --verbose --manifest-path examples/contract-terminate/Cargo.toml
- cargo test --no-default-features --features std, ink-experimental-engine --verbose --manifest-path examples/contract-transfer/Cargo.toml
examples-fmt:
stage: examples
<<: *docker-env
script:
- for example in examples/*/; do
cargo fmt --verbose --manifest-path ${example}/Cargo.toml -- --check;
done
- for contract in ${DELEGATOR_SUBCONTRACTS}; do
cargo fmt --verbose --manifest-path examples/delegator/${contract}/Cargo.toml -- --check;
done
examples-clippy-std:
stage: examples
<<: *docker-env
needs:
- job: clippy-std
artifacts: false
script:
- for example in examples/*/; do
cargo clippy --verbose --manifest-path ${example}/Cargo.toml -- -D warnings;
done
- for contract in ${DELEGATOR_SUBCONTRACTS}; do
cargo clippy --verbose --manifest-path examples/delegator/${contract}/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
- for contract in ${DELEGATOR_SUBCONTRACTS}; do
cargo clippy --verbose --manifest-path examples/delegator/${contract}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings;
done
examples-contract-build:
stage: examples
<<: *docker-env
script:
- cargo contract -V
- for example in examples/*/; do
pushd $example &&
cargo contract build &&
popd;
done
- for contract in ${DELEGATOR_SUBCONTRACTS}; do
pushd examples/delegator/$contract &&
cargo contract build &&
popd;
done
examples-contract-build-delegator:
stage: examples
<<: *docker-env
script:
- cargo contract -V
- cd examples/delegator/ && ./build-all.sh
examples-docs:
stage: examples
<<: *docker-env
variables:
RUSTDOCFLAGS: -Dwarnings
script:
# `--document-private-items` needs to be in here because currently our contract macro
# puts the contract functions in a private module.
# Once https://github.com/paritytech/ink/issues/336 has been implemented we can get rid
# of this flag.
- for example in examples/*/; do
cargo doc --manifest-path ${example}/Cargo.toml --document-private-items --verbose --no-deps;
done
- for contract in ${DELEGATOR_SUBCONTRACTS}; do
cargo doc --manifest-path examples/delegator/${contract}/Cargo.toml --document-private-items --verbose --no-deps;
done
#### stage: ink-waterfall
ink-waterfall:
......@@ -364,93 +77,3 @@ ink-waterfall:
script:
- ./scripts/.ci/trigger_pipeline.sh
allow_failure: true
#### stage: publish
publish-docs:
stage: publish
<<: *docker-env
needs:
- job: docs
artifacts: true
variables:
GIT_DEPTH: 100
rules:
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME == "tags"
# need to overwrite `before_script` from `*docker-env` here,
# this branch does not have a `./scripts/.ci/pre_cache.sh`
before_script:
- unset CARGO_TARGET_DIR
script:
- rm -rf /tmp/*
# Set git config
- rm -rf .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
# saving README and docs
- cp -r ./crate-docs/ /tmp/doc/
- cp README.md /tmp/doc/
- cp -r .images/ /tmp/doc/
- git checkout gh-pages
- mv _config.yml /tmp/doc/
# remove everything and restore generated docs, README and Jekyll config
- rm -rf ./*
- rm -rf ./.images
- mv /tmp/doc/* .
- mv /tmp/doc/.images .
# Upload files
- git add --all --force
- git status
# `git commit` has an exit code of > 0 if there is nothing to commit.
# This unfortunately causes GitLab to exit immediately and mark this
# job as failed subsequently.
# We don't want to mark the entire job as failed if there's nothing to
# publish though, hence the `|| true`.
- git commit -m "Updated docs for ${CI_COMMIT_REF_NAME} and pushed to gh-pages" || true
- git push origin gh-pages --force
after_script:
- rm -rf .git/ ./*
#### stage: fuzz
fuzz-tests:
stage: fuzz
<<: *docker-env
variables:
# The QUICKCHECK_TESTS default is 100
QUICKCHECK_TESTS: 20000
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
script:
# We fuzz-test only crates which possess the `ink-fuzz-tests` feature
- all_tests_passed=0
- for crate in ${ALL_CRATES}; do
if grep "ink-fuzz-tests =" crates/${crate}/Cargo.toml;
then
cargo test --verbose --features ink-fuzz-tests --manifest-path crates/${crate}/Cargo.toml --no-fail-fast -- fuzz_ || exit_code=$?;
all_tests_passed=$(( all_tests_passed | exit_code ));
fi
done
- if [ $all_tests_passed -eq 0 ]; then exit 0; fi
- |
curl -X "POST" "https://api.github.com/repos/paritytech/ink/issues" \
-H "Cookie: logged_in=no" \
-H "Authorization: token ${GITHUB_TOKEN}" \
-H "Content-Type: application/json; charset=utf-8" \
-d $'{
"title": "[ci] Failing fuzz tests on master ('"$( date +"%d %b %Y" )"')",
"body": "The CI job ['"${CI_JOB_ID}"']('"${CI_JOB_URL}"') just failed.\n\nThe offending commit is ['"${CI_COMMIT_TITLE}"'](https://github.com/paritytech/ink/commit/'"${CI_COMMIT_SHA}"').",
"assignees": [],
"labels": [
"P-high"
]
}'
- exit ${all_tests_passed}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment