.gitlab-ci.yml 1.96 KB
Newer Older
Denis_P's avatar
Denis_P committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# .gitlab-ci.yml
#
# ink
#
# pipelines can be triggered manually in the web


stages:
  - test
  - build

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"
  RUSTFLAGS:                       "-C link-dead-code"
Denis_P's avatar
Denis_P committed
19
  REGISTRY:                        registry.parity.io/parity/infrastructure/scripts
Denis_P's avatar
Denis_P committed
20
21
22
23
24
25
26
27
28
29

.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
30
  image:                           ${REGISTRY}/ink-ci-linux:latest
Denis_P's avatar
Denis_P committed
31
  before_script:
Denis_P's avatar
Denis_P committed
32
33
    - cargo -vV
    - rustc -vV
Denis_P's avatar
Denis_P committed
34
    - rustup show
Denis_P's avatar
Denis_P committed
35
    - bash --version
Denis_P's avatar
Denis_P committed
36
37
38
39
40
41
42
43
44
45
46
47
    - sccache -s
  only:
    - master
    - /^v[0-9]+\.[0-9]+.*$/        # i.e. v1.0, v2.1rc1
    - schedules
    - web
    - /^[0-9]+$/                   # PRs
  tags:
    - linux-docker

#### stage:                        test

Denis_P's avatar
Denis_P committed
48
check-workspace:
Denis_P's avatar
Denis_P committed
49
50
51
  stage:                           test
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
52
53
54
  - ./scripts/check-workspace.sh
  - check_workspace=$?
  - if [ $check_workspace -eq 0 ];
Denis_P's avatar
Denis_P committed
55
    then
Denis_P's avatar
Denis_P committed
56
57
      echo "Workspace checks have passed!";
      exit 0;
Denis_P's avatar
Denis_P committed
58
    else
Denis_P's avatar
Denis_P committed
59
60
61
62
63
      echo "Some workspace checks have not passed!";
      exit 1;
    fi


Denis_P's avatar
Denis_P committed
64
check-examples:
Denis_P's avatar
Denis_P committed
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
  stage:                           test
  <<:                              *docker-env
  script:
    - ./scripts/check-examples.sh
    - check_examples=$?
    - if [ $check_examples -eq 0 ];
      then
        echo "Examples checks have passed!";
        exit 0;
      else
        echo "Some examples checks have not passed!";
        exit 1;
      fi

# stage:                            build