# .gitlab-ci.yml # # ink # # pipelines can be triggered manually in the web stages: - check - workspace - examples 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" REGISTRY: registry.parity.io/parity/infrastructure/scripts 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 image: ${REGISTRY}/ink-ci-linux:latest before_script: - cargo -vV - 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 - sccache -s only: - master - /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - schedules - web - /^[0-9]+$/ # PRs retry: max: 2 when: - runner_system_failure - unknown_failure - api_failure tags: - 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: 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 -- -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 --all-features -- -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 -- -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