Skip to content

Commit

Permalink
subkey build, cargo audit (paritytech#2752)
Browse files Browse the repository at this point in the history
* subkey build, cargo audit

* some fixes

* cleanup

* review

* not to be launched on PRs

* not to be launched on PRs 2

* check-runtime should run on PRs only

* changed only to except, easier to read

* fix no jobs ran

* only: rewrites when it's last

* only: -branches wasn't needed

* benching subkey build

* benching subkey build 2

* subkey check

* not for 1.0

* cleanup
  • Loading branch information
TriplEight authored Jun 11, 2019
1 parent 5088c00 commit a56cb77
Showing 1 changed file with 43 additions and 29 deletions.
72 changes: 43 additions & 29 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@


stages:
- pre-test
- test
- build
- publish
- kubernetes
- flaming-fir

image: parity/rust-builder:latest

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"
DOCKER_OS: "debian:stretch"
ARCH: "x86_64"
Expand All @@ -38,17 +38,27 @@ variables:
environment:
name: parity-build

.compiler_info: &compiler_info
.docker-env: &docker-env
image: parity/rust-builder:latest
before_script:
- rustup show
- cargo --version
- sccache -s
only:
- tags
- master
- /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
- schedules
- web
- /^[0-9]+$/ # PRs
tags:
- linux-docker


#### stage: test

check-runtime:
stage: test
stage: pre-test
image: parity/tools:latest
<<: *kubernetes-build
only:
Expand All @@ -61,7 +71,7 @@ check-runtime:


check-line-width:
stage: test
stage: pre-test
image: parity/tools:latest
<<: *kubernetes-build
only:
Expand All @@ -71,23 +81,34 @@ check-line-width:
allow_failure: false


test-linux-stable: &test
cargo-audit:
stage: pre-test
<<: *docker-env
except:
- /^[0-9]+$/
script:
- cargo audit
allow_failure: true


cargo-check-subkey:
stage: test
<<: *docker-env
except:
- /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
script:
- cd ./subkey
- time cargo check --release # makes sense to save artifacts for building it
- sccache -s


test-linux-stable:
stage: test
<<: *compiler_info
<<: *docker-env
variables:
RUST_TOOLCHAIN: stable
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: -Cdebug-assertions=y
TARGET: native
tags:
- linux-docker
only:
- tags
- master
- schedules
- web
- /^[0-9]+$/
except:
variables:
- $DEPLOY_TAG
Expand Down Expand Up @@ -126,11 +147,10 @@ test-linux-stable-int: &test

check-web-wasm:
stage: test
<<: *compiler_info
<<: *docker-env
allow_failure: true
only:
- master
- /^[0-9]+$/
except:
- /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
script:
# WASM support is in progress. As more and more crates support WASM, we
# should add entries here. See https://github.com/paritytech/substrate/issues/2416
Expand All @@ -155,8 +175,6 @@ check-web-wasm:
- time cargo web build -p substrate-telemetry
- time cargo web build -p substrate-trie
- sccache -s
tags:
- linux-docker

.build-only: &build-only
only:
Expand All @@ -169,13 +187,11 @@ check-web-wasm:
build-linux-release:
stage: build
<<: *collect-artifacts
<<: *docker-env
<<: *build-only
<<: *compiler_info
except:
variables:
- $DEPLOY_TAG
tags:
- linux-docker
script:
- ./scripts/build.sh --locked
- time cargo build --release --verbose
Expand All @@ -197,7 +213,7 @@ build-linux-release:

build-rust-doc-release:
stage: build
<<: *compiler_info
<<: *docker-env
allow_failure: true
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc"
Expand All @@ -206,8 +222,6 @@ build-rust-doc-release:
paths:
- ./crate-docs
<<: *build-only
tags:
- linux-docker
script:
- ./scripts/build.sh --locked
- rm -f ./crate-docs/index.html # use it as an indicator if the job succeeds
Expand Down

0 comments on commit a56cb77

Please sign in to comment.