.gitlab-ci.yml 3.44 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
Denis_P committed
48
49
cargo-check-af:
  stage:                           check-workspace
Denis_P's avatar
Denis_P committed
50
51
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
52
53
54
55
  - time cargo check --verbose --all --all-features

cargo-check-nf:
  stage:                           check-workspace
Denis_P's avatar
Denis_P committed
56
57
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
58
  - time cargo check --verbose --all --no-default-features
Denis_P's avatar
Denis_P committed
59
60
61
62
63

cargo-fmt:
  stage:                           check-workspace
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
64
  - time cargo fmt --verbose --all -- --check
Denis_P's avatar
Denis_P committed
65
66
67
68
69

cargo-clippy-af:
  stage:                           check-workspace
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
70
  - time cargo clippy --verbose --all --all-features -- -D warnings
Denis_P's avatar
Denis_P committed
71
72
73
74
75

cargo-clippy-nf:
  stage:                           check-workspace
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
76
  - time cargo clippy --verbose --all --no-default-features -- -D warnings
Denis_P's avatar
Denis_P committed
77
78
79
80
81

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

Denis_P's avatar
Denis_P committed
84
85
cargo-build-nf:
  stage:                           check-workspace
Denis_P's avatar
Denis_P committed
86
87
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
88
89
90
91
  - time cargo build --verbose --all --no-default-features --release --target=wasm32-unknown-unknown


  # stage:                            build
Denis_P's avatar
Denis_P committed
92

Denis_P's avatar
Denis_P committed
93
examples-wasm:
Denis_P's avatar
Denis_P committed
94
  stage:                           examples
Denis_P's avatar
Denis_P committed
95
96
97
98
99
  <<:                              *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
100
    - sccache -s
Denis_P's avatar
Denis_P committed
101
102

examples-test:
Denis_P's avatar
Denis_P committed
103
  stage:                           examples
Denis_P's avatar
Denis_P committed
104
105
106
107
108
  <<:                              *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
109
    - sccache -s
Denis_P's avatar
Denis_P committed
110
111

examples-abi:
Denis_P's avatar
Denis_P committed
112
  stage:                           examples
Denis_P's avatar
Denis_P committed
113
114
115
116
117
  <<:                              *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
118
    - sccache -s