.gitlab-ci.yml 3.51 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
44
45
46
    - 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
47
#### stage:                        check-workspace
Denis_P's avatar
Denis_P committed
48

Denis_P's avatar
Denis_P committed
49
50
cargo-check-af:
  stage:                           check-workspace
Denis_P's avatar
Denis_P committed
51
52
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
53
  - cargo check --verbose --all --all-features
Denis_P's avatar
Denis_P committed
54
55
56

cargo-check-nf:
  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 --no-default-features
Denis_P's avatar
Denis_P committed
60
61
62
63
64

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

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

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

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

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

Denis_P's avatar
Denis_P committed
91
#### stage:                        examples
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
  <<:                              *docker-env
  script:
    - for example in $(ls examples/lang); do
Denis_P's avatar
Denis_P committed
98
        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
99
      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
  <<:                              *docker-env
  script:
    - for example in $(ls examples/lang); do
Denis_P's avatar
Denis_P committed
107
        cargo test --verbose --manifest-path examples/lang/$example/Cargo.toml;
Denis_P's avatar
Denis_P committed
108
      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
  <<:                              *docker-env
  script:
    - for example in $(ls examples/lang); do
Denis_P's avatar
Denis_P committed
116
        cargo run --package abi-gen --manifest-path examples/lang/$example/Cargo.toml;
Denis_P's avatar
Denis_P committed
117
      done
Denis_P's avatar
typo    
Denis_P committed
118
    - sccache -s