.gitlab-ci.yml 1.38 KiB
Newer Older
Denis_P's avatar
Denis_P committed
# .gitlab-ci.yml
#
# paracon-node
#
# pipelines can be triggered manually in the web


stages:
    - test
  
variables:
  GIT_STRATEGY:                    fetch
  GIT_DEPTH:                       100
Denis_P's avatar
Denis_P committed
  CARGO_INCREMENTAL:               0
Denis_P's avatar
Denis_P committed
  CARGO_TARGET_DIR:                "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}"

.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
Denis_P's avatar
Denis_P committed
  image:                           paritytech/ci-linux:production
Denis_P's avatar
Denis_P committed
  before_script:
    - cargo -vV
    - rustc -vV
    - rustup show
    - bash --version
    - mkdir -p ${CARGO_TARGET_DIR}
    - sccache -s
  only:
    - master
    - /^v[0-9]+\.[0-9]+.*$/        # i.e. v1.0, v2.1rc1
    - schedules
    - web
    - /^[0-9]+$/                   # PRs
  dependencies:                    []
  interruptible:                   true
  retry:
    max: 2
    when:
      - runner_system_failure
      - unknown_failure
      - api_failure
  tags:
    - linux-docker

### stage:                         test

build-test:
  stage:                           test
  <<:                              *docker-env
  script:
    - cargo build --release
    - cargo test --all