.gitlab-ci.yml 3.62 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

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

.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
29
  image:                           ${REGISTRY}/ink-ci-linux:latest
Denis_P's avatar
Denis_P committed
30
  before_script:
Denis_P's avatar
Denis_P committed
31
32
    - cargo -vV
    - rustc -vV
Denis_P's avatar
Denis_P committed
33
    - rustup show
Denis_P's avatar
Denis_P committed
34
    - bash --version
Denis_P's avatar
Denis_P committed
35
36
    # global RUSTFLAGS overrides the linker args so this way is better to pass the flags
    - printf '[build]\nrustflags = ["-C", "link-dead-code"]\n' | tee ${CARGO_HOME}/config
Denis_P's avatar
Denis_P committed
37
38
39
40
41
42
43
    - sccache -s
  only:
    - master
    - /^v[0-9]+\.[0-9]+.*$/        # i.e. v1.0, v2.1rc1
    - schedules
    - web
    - /^[0-9]+$/                   # PRs
44
45
46
47
48
49
  retry:
    max: 2
    when: 
      - runner_system_failure
      - unknown_failure
      - api_failure
Denis_P's avatar
Denis_P committed
50
51
52
  tags:
    - linux-docker

Denis_P's avatar
Denis_P committed
53
#### stage:                        check-workspace
Denis_P's avatar
Denis_P committed
54

Denis_P's avatar
Denis_P committed
55
56
cargo-check-af:
  stage:                           check-workspace
Denis_P's avatar
Denis_P committed
57
58
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
59
  - cargo check --verbose --all --all-features
Denis_P's avatar
Denis_P committed
60
61
62

cargo-check-nf:
  stage:                           check-workspace
Denis_P's avatar
Denis_P committed
63
64
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
65
  - cargo check --verbose --all --no-default-features
Denis_P's avatar
Denis_P committed
66
67
68
69
70

cargo-fmt:
  stage:                           check-workspace
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
71
  - cargo fmt --verbose --all -- --check
Denis_P's avatar
Denis_P committed
72
73
74
75
76

cargo-clippy-af:
  stage:                           check-workspace
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
77
  - cargo clippy --verbose --all --all-features -- -D warnings
Denis_P's avatar
Denis_P committed
78
79
80
81
82

cargo-clippy-nf:
  stage:                           check-workspace
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
83
  - cargo clippy --verbose --all --no-default-features -- -D warnings
Denis_P's avatar
Denis_P committed
84
85
86
87
88

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

Denis_P's avatar
Denis_P committed
91
92
cargo-build-nf:
  stage:                           check-workspace
Denis_P's avatar
Denis_P committed
93
94
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
95
  - cargo build --verbose --all --no-default-features --release --target=wasm32-unknown-unknown
Denis_P's avatar
Denis_P committed
96

Denis_P's avatar
Denis_P committed
97
#### stage:                        examples
Denis_P's avatar
Denis_P committed
98

Denis_P's avatar
Denis_P committed
99
examples-wasm:
Denis_P's avatar
Denis_P committed
100
  stage:                           examples
Denis_P's avatar
Denis_P committed
101
102
103
  <<:                              *docker-env
  script:
    - for example in $(ls examples/lang); do
Denis_P's avatar
Denis_P committed
104
        cargo build --release --no-default-features --target=wasm32-unknown-unknown --verbose --manifest-path examples/lang/$example/Cargo.toml;
Denis_P's avatar
Denis_P committed
105
      done
Denis_P's avatar
typo    
Denis_P committed
106
    - sccache -s
Denis_P's avatar
Denis_P committed
107
108

examples-test:
Denis_P's avatar
Denis_P committed
109
  stage:                           examples
Denis_P's avatar
Denis_P committed
110
111
112
  <<:                              *docker-env
  script:
    - for example in $(ls examples/lang); do
Denis_P's avatar
Denis_P committed
113
        cargo test --verbose --manifest-path examples/lang/$example/Cargo.toml;
Denis_P's avatar
Denis_P committed
114
      done
Denis_P's avatar
typo    
Denis_P committed
115
    - sccache -s
Denis_P's avatar
Denis_P committed
116
117

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