.gitlab-ci.yml 3.52 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
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# .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"

.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
  image:                           parity/rust-builder:latest
  before_script:
    - rustup show
    - cargo --version
    - 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

# addons:
#   apt:
#     packages:
#       - libcurl4-openssl-dev
#       - libelf-dev
#       - libdw-dev
#       - binutils-dev
#       - libiberty-dev
#       - g++
#       - cmake
#       - zlib1g-dev

Denis_P's avatar
Denis_P committed
57
check-workspace:
Denis_P's avatar
Denis_P committed
58
59
60
61
  stage:                           test
  <<:                              *docker-env
  before_script:
    # Print rustc and cargo versions
Denis_P's avatar
Denis_P committed
62
63
64
65
    - rustc -vV
    - cargo -vV
    - rustup show
    - bash --version
Denis_P's avatar
Denis_P committed
66
    # Install cargo-kcov Cargo plugin
Denis_P's avatar
Denis_P committed
67
68
    # - cargo install --force cargo-kcov
    # - cargo kcov -vV
Denis_P's avatar
Denis_P committed
69
    # Install kcov binary
Denis_P's avatar
Denis_P committed
70
71
72
73
74
75
76
77
78
79
80
    # - curl https://github.com/SimonKagstrom/kcov/archive/v36.tar.gz
    # - tar xzf v36.tar.gz
    # - pushd kcov-36
    # - mkdir build
    # - pushd build
    # - cmake ..
    # - make
    # - sudo make install # Puts kcov in the default location usually /usr/local/bin/kcov
    # - kcov --version
    # - popd
    # - popd
Denis_P's avatar
Denis_P committed
81
    # Export cargo binaries, python and misc settings
Denis_P's avatar
Denis_P committed
82
    # - export PATH=$HOME/.local/bin:$HOME/.cargo/bin:$HOME/Library/Python/2.7/bin:$PATH
Denis_P's avatar
Denis_P committed
83
    # Print current work directory state as directions.
Denis_P's avatar
Denis_P committed
84
    # - ls -lah
Denis_P's avatar
Denis_P committed
85
    # install rust components
Denis_P's avatar
Denis_P committed
86
87
    - rustup default nightly-2019-08-30
    - rustup target add wasm32-unknown-unknown
Denis_P's avatar
Denis_P committed
88
89
90
    - rustup component add clippy rustfmt
    # - rustup target add wasm32-unknown-unknown
  script:
Denis_P's avatar
Denis_P committed
91
92
  - ./scripts/check-workspace.sh
  - check_workspace=$?
Denis_P's avatar
Denis_P committed
93
94
95
96
97
98
99
    # if [ $check_workspace -eq 0 ]
    # then
    #   # Execute and upload kcov results
    #   cargo kcov --verbose --coveralls --all --no-clean-rebuild
    #   kcov=$?
    #   bash <(curl -s https://codecov.io/bash)
    # fi
Denis_P's avatar
Denis_P committed
100
  - if [ $check_workspace -eq 0 ];
Denis_P's avatar
Denis_P committed
101
    then
Denis_P's avatar
Denis_P committed
102
103
      echo "Workspace checks have passed!";
      exit 0;
Denis_P's avatar
Denis_P committed
104
    else
Denis_P's avatar
Denis_P committed
105
106
107
108
109
      echo "Some workspace checks have not passed!";
      exit 1;
    fi


Denis_P's avatar
Denis_P committed
110
check-examples:
Denis_P's avatar
Denis_P committed
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
  stage:                           test
  <<:                              *docker-env
  before_script:
    # Print rustc and cargo versions
    - rustc -vV
    - cargo -vV
    - rustup show
    - bash --version
    # install rust components
    - rustup default nightly-2019-08-30
    - rustup target add wasm32-unknown-unknown
    - rustup component add clippy rustfmt
  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