Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change (CI): CARGO_HOME, RUST_INCREMENTAL, no artifacts for needs, only changed to rules #495

Merged
merged 2 commits into from
Sep 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 32 additions & 23 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ stages:
variables:
GIT_STRATEGY: fetch
GIT_DEPTH: 100
CARGO_INCREMENTAL: 0
CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}"
CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}"
CI_SERVER_NAME: "GitLab CI"
REGISTRY: "paritytech"
ALL_CRATES: "core core/derive alloc prelude primitives lang lang/macro lang/ir"

.collect-artifacts: &collect-artifacts
Expand All @@ -28,21 +28,20 @@ variables:
- artifacts/

.docker-env: &docker-env
image: ${REGISTRY}/ink-ci-linux:latest
image: paritytech/ink-ci-linux:latest
before_script:
- cargo -vV
- rustc -vV
- rustup show
- bash --version
- ./scripts/pre_cache.sh
- sccache -s
only:
- master
- /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
- schedules
- web
- branches
dependencies: []
rules:
- 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 =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
interruptible: true
retry:
max: 2
Expand Down Expand Up @@ -79,7 +78,8 @@ build-std:
stage: workspace
<<: *docker-env
needs:
- check-std
- job: check-std
artifacts: false
script:
- for crate in ${ALL_CRATES}; do
cargo build --verbose --all-features --release --manifest-path ${crate}/Cargo.toml;
Expand All @@ -89,7 +89,8 @@ build-wasm:
stage: workspace
<<: *docker-env
needs:
- check-wasm
- job: check-wasm
artifacts: false
script:
- for crate in ${ALL_CRATES}; do
cargo build --verbose --no-default-features --release --target wasm32-unknown-unknown --manifest-path ${crate}/Cargo.toml;
Expand All @@ -99,15 +100,17 @@ test:
stage: workspace
<<: *docker-env
needs:
- check-std
- job: check-std
artifacts: false
script:
- cargo test --verbose --all-features --no-fail-fast --workspace

codecov:
stage: workspace
<<: *docker-env
needs:
- check-std
- job: check-std
artifacts: false
variables:
# Variables partly came from https://github.com/mozilla/grcov/blob/master/README.md
CARGO_INCREMENTAL: 0
Expand Down Expand Up @@ -140,7 +143,8 @@ clippy-std:
stage: workspace
<<: *docker-env
needs:
- check-std
- job: check-std
artifacts: false
script:
- for crate in ${ALL_CRATES}; do
cargo clippy --verbose --all-features --manifest-path ${crate}/Cargo.toml -- -D warnings;
Expand All @@ -150,7 +154,8 @@ clippy-wasm:
stage: workspace
<<: *docker-env
needs:
- check-wasm
- job: check-wasm
artifacts: false
script:
- for crate in ${ALL_CRATES}; do
cargo clippy --verbose --no-default-features --manifest-path ${crate}/Cargo.toml --target wasm32-unknown-unknown -- -D warnings;
Expand All @@ -176,7 +181,8 @@ examples-test:
stage: examples
<<: *docker-env
needs:
- clippy-std
- job: clippy-std
artifacts: false
script:
- for example in examples/*/; do
cargo test --verbose --manifest-path ${example}/Cargo.toml;
Expand All @@ -194,7 +200,8 @@ examples-clippy-std:
stage: examples
<<: *docker-env
needs:
- clippy-std
- job: clippy-std
artifacts: false
script:
- for example in examples/*/; do
cargo clippy --verbose --manifest-path ${example}/Cargo.toml -- -D warnings;
Expand Down Expand Up @@ -223,7 +230,8 @@ examples-generate-metadata:
stage: examples
<<: *docker-env
needs:
- build-wasm
- job: build-wasm
artifacts: false
script:
- *update-cargo-contract
- for example in examples/*/; do
Expand All @@ -239,10 +247,11 @@ publish-docs:
<<: *docker-env
variables:
GIT_DEPTH: 0
only:
- master
- schedules
- tags
rules:
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME == "tags"
script:
- rm -rf /tmp/*
- unset CARGO_TARGET_DIR
Expand Down