.gitlab-ci.yml 1.51 KiB
Newer Older
stages:
  - test
  - build

variables:
Denis_P's avatar
Denis_P committed
  GIT_STRATEGY:                    fetch
  GIT_SUBMODULE_STRATEGY:          recursive
Denis_P's avatar
Denis_P committed
  GIT_DEPTH:                       3
  CARGO_INCREMENTAL:               0
  CARGO_TARGET_DIR:                "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}"
  CI_SERVER_NAME:                  "GitLab CI"
  RUST_TOOLCHAIN:                  "stable"
.docker-env:                       &docker-env
  image:                           paritytech/ci-linux:production
Denis_P's avatar
Denis_P committed
  before_script:
Denis_P's avatar
Denis_P committed
    - cargo -vV
    - rustc -vV
Denis_P's avatar
Denis_P committed
    - rustup show
    - cargo --version
    - sccache -s
Denis_P's avatar
Denis_P committed
  dependencies:                    []
  interruptible:                   true
  retry:
    max: 2
Denis_P's avatar
Denis_P committed
    when:
      - runner_system_failure
      - unknown_failure
      - api_failure
  tags:
    - linux-docker

#### stage:                        test

test-rust-stable:
  stage:                           test
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
    - ./scripts/init.sh
    - time cargo test --all --release --locked
Wei Tang's avatar
Wei Tang committed
    - cd substrate && time cargo test --all --release --locked
Denis_P's avatar
Denis_P committed
    - sccache -s
  only:
    - triggers
    - tags
    - master
    - schedules
    - web

#### stage:                        build

build-linux:
  stage:                           build
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
    - ./scripts/init.sh
Denis_P's avatar
Denis_P committed
    - time cargo build --release
Wei Tang's avatar
Wei Tang committed
    - cd substrate && time cargo build --release
Denis_P's avatar
Denis_P committed
    - sccache -s
  only:
    - master
    - tags
    - web