forked from paritytech/parity-scale-codec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
122 lines (106 loc) · 3.65 KB
/
.gitlab-ci.yml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# .gitlab-ci.yml
#
stages:
- check
- test
- build
variables:
GIT_STRATEGY: fetch
GIT_DEPTH: "100"
CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}"
CARGO_INCREMENTAL: 0
CI_IMAGE: "paritytech/parity-scale-codec:production"
workflow:
rules:
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
.docker-env: &docker-env
image: $CI_IMAGE
before_script:
- cargo -vV
- rustc -vV
- rustup show
- bash --version
- ./scripts/ci/pre_cache.sh
- sccache -s
rules:
- if: $CI_PIPELINE_SOURCE == "trigger"
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME == "tags"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
interruptible: true
retry:
max: 2
when:
- runner_system_failure
- unknown_failure
- api_failure
tags:
- linux-docker
#### stage: check
check-rust-stable-no_derive_no_std_full:
stage: check
<<: *docker-env
script:
- time cargo +stable check --verbose --no-default-features --features bit-vec,bytes,generic-array,full
- sccache -s
check-rust-stable-no_derive_no_std:
stage: check
<<: *docker-env
script:
- time cargo +stable check --verbose --no-default-features --features bit-vec,bytes,generic-array
- sccache -s
check-rust-stable-no_std-chain-error:
stage: check
<<: *docker-env
script:
- time cargo +stable check --verbose --no-default-features --features chain-error
- sccache -s
check-rust-stable-no_derive_full:
stage: check
<<: *docker-env
script:
- time cargo +stable check --verbose --features bit-vec,bytes,generic-array,full
- sccache -s
#### stage: test
test-rust-stable:
stage: test
<<: *docker-env
script:
- time cargo +stable test --verbose --all --features bit-vec,bytes,generic-array,derive,max-encoded-len
- sccache -s
test-rust-stable-no_derive:
stage: test
<<: *docker-env
script:
- time cargo +stable test --verbose --features bit-vec,bytes,generic-array
- sccache -s
bench-rust-nightly:
stage: test
<<: *docker-env
script:
- time cargo +nightly bench --features bit-vec,bytes,generic-array,derive
- sccache -s
miri:
stage: test
<<: *docker-env
variables:
RUST_BACKTRACE: 1
MIRIFLAGS: "-Zmiri-disable-isolation"
script:
- time cargo +nightly miri test --features bit-vec,bytes,generic-array,arbitrary --release
#### stage: build
build-linux-ubuntu-amd64:
stage: build
<<: *docker-env
rules:
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME == "tags"
script:
- cargo build --verbose --release --features bit-vec,bytes,generic-array,derive
- sccache -s