stages:
- check
- test
- build
variables:
GIT_STRATEGY: fetch
GIT_DEPTH: "100"
CARGO_INCREMENTAL: 0
CI_IMAGE: "paritytech/parity-scale-codec:production"
default:
cache: {}
interruptible: true
retry:
max: 2
when:
- runner_system_failure
- unknown_failure
- api_failure
.docker-env: &docker-env
image: $CI_IMAGE
before_script:
- cargo -vV
- rustc -vV
- rustup show
- bash --version
rules:
- if: $CI_PIPELINE_SOURCE == "trigger"
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME == "tags"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ tags:
- linux-docker-vm-c2
check-clippy:
stage: check
<<: *docker-env
script:
- rustup component add clippy --toolchain stable-x86_64-unknown-linux-gnu
- time cargo +stable clippy --locked -- -Dwarnings
- time cargo +stable clippy --locked -p parity-scale-codec-derive -- -Dwarnings
- time cargo +stable clippy --locked --test clippy -- -Dwarnings
check-rust-stable-no_derive_no_std:
stage: check
<<: *docker-env
variables:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- time cargo +stable check --verbose --no-default-features --features bit-vec,bytes,generic-array
check-rust-stable-no_std-chain-error:
stage: check
<<: *docker-env
variables:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- time cargo +stable check --verbose --no-default-features --features chain-error
check-rust-stable-no_derive:
stage: check
<<: *docker-env
variables:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- time cargo +stable check --verbose --features bit-vec,bytes,generic-array
check-rust-stable-only_mel:
stage: check
<<: *docker-env
variables:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- time cargo +stable check --verbose --features max-encoded-len
test-rust-stable:
stage: test
<<: *docker-env
variables:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- time cargo +stable test --verbose --all --features bit-vec,bytes,generic-array,derive,max-encoded-len
test-rust-stable-no_derive:
stage: test
<<: *docker-env
variables:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- time cargo +stable test --verbose --features bit-vec,bytes,generic-array
test-rust-stable-only_mel:
stage: test
<<: *docker-env
variables:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- time cargo +stable test --verbose --features max-encoded-len
test-rust-stable-only_mel-no_default_std:
stage: test
<<: *docker-env
variables:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- time cargo +stable test --verbose --features max-encoded-len,std --no-default-features
bench-rust-nightly:
stage: test
<<: *docker-env
script:
- time cargo +nightly bench --features bit-vec,bytes,generic-array,derive
miri:
stage: test
<<: *docker-env
variables:
RUST_BACKTRACE: 1
MIRIFLAGS: "-Zmiri-disable-isolation"
script:
- time cargo +nightly miri test --features bit-vec,bytes,generic-array,arbitrary --release
build-no-std:
stage: test
<<: *docker-env
variables:
RUST_BACKTRACE: 1
script:
- rustup target add thumbv6m-none-eabi
- time cargo build --target thumbv6m-none-eabi --no-default-features
build-no-atomic-ptrs:
stage: test
<<: *docker-env
variables:
RUST_BACKTRACE: 1
script:
- cargo +nightly check --target bpfel-unknown-none -Zbuild-std="core,alloc" --no-default-features --features generic-array,derive,max-encoded-len,chain-error
build-linux-ubuntu-amd64:
stage: build
<<: *docker-env
rules:
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME == "tags"
script:
- cargo build --verbose --release --features bit-vec,bytes,generic-array,derive