Newer
Older
# .gitlab-ci.yml
#
# ink
#
# pipelines can be triggered manually in the web
stages:
variables:
GIT_STRATEGY: fetch
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"
ALL_CRATES: "core alloc utils lang2 lang2/macro cli"
WASM_CRATES: "core alloc utils lang2 lang2/macro"
.collect-artifacts: &collect-artifacts
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
when: on_success
expire_in: 7 days
paths:
- artifacts/
.docker-env: &docker-env
- 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
- sccache -s
only:
- master
- /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
- schedules
- web
- /^[0-9]+$/ # PRs
- runner_system_failure
- unknown_failure
- api_failure
- for crate in ${ALL_CRATES}; do
cargo check --verbose --all-features;
done
- for crate in ${WASM_CRATES}; do
cargo check --verbose --no-default-features --target wasm32-unknown-unknown --manifest-path ${crate}/Cargo.toml;
done
- for crate in ${ALL_CRATES}; do
cargo build --verbose --all-features --release;
done
- for crate in ${WASM_CRATES}; do
cargo build --verbose --no-default-features --release --target wasm32-unknown-unknown --manifest-path ${crate}/Cargo.toml;
done
- for crate in ${ALL_CRATES}; do
cargo test --verbose --all-features --release;
done
- for crate in ${ALL_CRATES}; do
cargo clippy --verbose --all-features -- -D warnings;
done
cargo clippy --verbose --manifest-path ${crate}/Cargo.toml --no-default-features --target wasm32-unknown-unknown -- -D warnings;
<<: *docker-env
script:
- for crate in ${ALL_CRATES}; do
cargo fmt --verbose -- --check;
done
- for example in examples/lang2/*; do
cargo test --verbose --manifest-path ${example}/Cargo.toml;
cargo fmt --verbose --manifest-path ${example}/Cargo.toml -- --check;
cargo clippy --verbose --manifest-path ${example}/Cargo.toml -- -D warnings;
done
examples-clippy-wasm:
stage: examples
<<: *docker-env
script:
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