Unverified Commit adcde460 authored by Denis_P's avatar Denis_P 🏑 Committed by GitHub
Browse files

CI: add miri test; chore (#240)



* CI: add miri test; new phase; remoe CARGO_HOME cache

* add miri and falgs to test

* Update .gitlab-ci.yml

Co-authored-by: thiolliere's avatarGuillaume Thiolliere <gui.thiolliere@gmail.com>
parent b5d2ea7f
Pipeline #120477 passed with stages
in 23 minutes and 43 seconds
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
# #
stages: stages:
- check
- test - test
- build - build
variables: variables:
GIT_STRATEGY: fetch GIT_STRATEGY: fetch
GIT_DEPTH: "100" GIT_DEPTH: "100"
CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}"
CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}" CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}"
CARGO_INCREMENTAL: 0 CARGO_INCREMENTAL: 0
CI_SERVER_NAME: "GitLab CI" CI_SERVER_NAME: "GitLab CI"
...@@ -19,7 +19,7 @@ workflow: ...@@ -19,7 +19,7 @@ workflow:
- if: $CI_COMMIT_BRANCH - if: $CI_COMMIT_BRANCH
.docker-env: &docker-env .docker-env: &docker-env
image: paritytech/ci-linux:production image: paritytech/ink-ci-linux:production
before_script: before_script:
- cargo -vV - cargo -vV
- rustc -vV - rustc -vV
...@@ -45,41 +45,43 @@ workflow: ...@@ -45,41 +45,43 @@ workflow:
tags: tags:
- linux-docker - linux-docker
#### stage: test #### stage: check
test-rust-stable: check-rust-stable-no_derive_no_std_full:
stage: test stage: check
<<: *docker-env <<: *docker-env
script: script:
- time cargo test --verbose --all --features bit-vec,generic-array,derive - time cargo +stable check --verbose --no-default-features --features bit-vec,generic-array,full
- sccache -s - sccache -s
test-rust-stable-no_derive: check-rust-stable-no_derive_no_std:
stage: test stage: check
<<: *docker-env <<: *docker-env
script: script:
- time cargo test --verbose --features bit-vec,generic-array - time cargo +stable check --verbose --no-default-features --features bit-vec,generic-array
- sccache -s - sccache -s
check-rust-stable-no_derive_no_std_full: check-rust-stable-no_derive_full:
stage: test stage: check
<<: *docker-env <<: *docker-env
script: script:
- time cargo check --verbose --no-default-features --features bit-vec,generic-array,full - time cargo +stable check --verbose --features bit-vec,generic-array,full
- sccache -s - sccache -s
check-rust-stable-no_derive_no_std: #### stage: test
test-rust-stable:
stage: test stage: test
<<: *docker-env <<: *docker-env
script: script:
- time cargo check --verbose --no-default-features --features bit-vec,generic-array - time cargo +stable test --verbose --all --features bit-vec,generic-array,derive
- sccache -s - sccache -s
check-rust-stable-no_derive_full: test-rust-stable-no_derive:
stage: test stage: test
<<: *docker-env <<: *docker-env
script: script:
- time cargo check --verbose --features bit-vec,generic-array,full - time cargo +stable test --verbose --features bit-vec,generic-array
- sccache -s - sccache -s
bench-rust-nightly: bench-rust-nightly:
...@@ -89,6 +91,15 @@ bench-rust-nightly: ...@@ -89,6 +91,15 @@ bench-rust-nightly:
- time cargo +nightly bench --features bit-vec,generic-array,derive - time cargo +nightly bench --features bit-vec,generic-array,derive
- sccache -s - sccache -s
miri:
stage: test
<<: *docker-env
variables:
RUST_BACKTRACE: 1
MIRIFLAGS: "-Zmiri-disable-isolation"
script:
- time cargo +nightly miri test --features bit-vec,generic-array,arbitrary --release
#### stage: build #### stage: build
build-linux-ubuntu-amd64: build-linux-ubuntu-amd64:
......
...@@ -6,7 +6,7 @@ set -u ...@@ -6,7 +6,7 @@ set -u
# create such directory and # create such directory and
# copy recursively all the files from the newest dir which has $CI_JOB_NAME, if it exists # copy recursively all the files from the newest dir which has $CI_JOB_NAME, if it exists
# caches are in /ci-cache/${CI_PROJECT_NAME}/${2}/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME} # cache lives in /ci-cache/${CI_PROJECT_NAME}/${2}/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}
function prepopulate { function prepopulate {
if [[ ! -d $1 ]]; then if [[ ! -d $1 ]]; then
...@@ -24,8 +24,4 @@ function prepopulate { ...@@ -24,8 +24,4 @@ function prepopulate {
fi fi
} }
# CARGO_HOME cache was moved to the same "project/cache_type/branch_name/job_name" level as
# CARGO_TARGET_DIR because of frequent weird data-race issues. This just means that the same cache that
# would have been used for the entire pipeline will be duplicated for the each job.
prepopulate "$CARGO_HOME" cargo
prepopulate "$CARGO_TARGET_DIR" targets prepopulate "$CARGO_TARGET_DIR" targets
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