.gitlab-ci.yml 3.84 KB
Newer Older
Denis_P's avatar
Denis_P committed
1 2 3 4 5 6 7 8
# .gitlab-ci.yml
#
# ink
#
# pipelines can be triggered manually in the web


stages:
Denis_P's avatar
Denis_P committed
9 10
  - check-workspace
  - examples
Denis_P's avatar
Denis_P committed
11 12 13 14 15 16 17 18

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
    - sccache -s
  only:
    - master
    - /^v[0-9]+\.[0-9]+.*$/        # i.e. v1.0, v2.1rc1
    - schedules
    - web
    - /^[0-9]+$/                   # PRs
  tags:
    - linux-docker

Denis_P's avatar
Denis_P committed
46
#### stage:                        check-workspace
Denis_P's avatar
Denis_P committed
47

Denis_P's avatar
error  
Denis_P committed
48
kcov:
Denis_P's avatar
Denis_P committed
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
  stage:                           check-workspace
  <<:                              *docker-env
  script:
    - |
      ./scripts/check-workspace.sh
      check_workspace=$?

      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
64 65
cargo-check-af:
  stage:                           check-workspace
Denis_P's avatar
Denis_P committed
66 67
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
68 69 70 71
  - time cargo check --verbose --all --all-features

cargo-check-nf:
  stage:                           check-workspace
Denis_P's avatar
Denis_P committed
72 73
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
74
  - time cargo check --verbose --all --no-default-features
Denis_P's avatar
Denis_P committed
75 76 77 78 79

cargo-fmt:
  stage:                           check-workspace
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
80
  - time cargo fmt --verbose --all -- --check
Denis_P's avatar
Denis_P committed
81 82 83 84 85

cargo-clippy-af:
  stage:                           check-workspace
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
86
  - time cargo clippy --verbose --all --all-features -- -D warnings
Denis_P's avatar
Denis_P committed
87 88 89 90 91

cargo-clippy-nf:
  stage:                           check-workspace
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
92
  - time cargo clippy --verbose --all --no-default-features -- -D warnings
Denis_P's avatar
Denis_P committed
93 94 95 96 97

cargo-test-af:
  stage:                           check-workspace
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
98
  - time cargo test --verbose --all --all-features
Denis_P's avatar
Denis_P committed
99

Denis_P's avatar
Denis_P committed
100 101
cargo-build-nf:
  stage:                           check-workspace
Denis_P's avatar
Denis_P committed
102 103
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
104 105
  - time cargo build --verbose --all --no-default-features --release --target=wasm32-unknown-unknown

Denis_P's avatar
Denis_P committed
106
#### stage:                        examples
Denis_P's avatar
Denis_P committed
107

Denis_P's avatar
Denis_P committed
108
examples-wasm:
Denis_P's avatar
Denis_P committed
109
  stage:                           examples
Denis_P's avatar
Denis_P committed
110 111 112 113 114
  <<:                              *docker-env
  script:
    - for example in $(ls examples/lang); do
        time cargo build --release --no-default-features --target=wasm32-unknown-unknown --verbose --manifest-path examples/lang/$example/Cargo.toml;
      done
Denis_P's avatar
typo  
Denis_P committed
115
    - sccache -s
Denis_P's avatar
Denis_P committed
116 117

examples-test:
Denis_P's avatar
Denis_P committed
118
  stage:                           examples
Denis_P's avatar
Denis_P committed
119 120 121 122 123
  <<:                              *docker-env
  script:
    - for example in $(ls examples/lang); do
        time cargo test --verbose --manifest-path examples/lang/$example/Cargo.toml;
      done
Denis_P's avatar
typo  
Denis_P committed
124
    - sccache -s
Denis_P's avatar
Denis_P committed
125 126

examples-abi:
Denis_P's avatar
Denis_P committed
127
  stage:                           examples
Denis_P's avatar
Denis_P committed
128 129 130 131 132
  <<:                              *docker-env
  script:
    - for example in $(ls examples/lang); do
        time cargo run --package abi-gen --manifest-path examples/lang/$example/Cargo.toml;
      done
Denis_P's avatar
typo  
Denis_P committed
133
    - sccache -s