forked from paritytech/cumulus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
92 lines (83 loc) · 2.37 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
# .gitlab-ci.yml
#
# cumulus
#
# pipelines can be triggered manually in the web
stages:
- test
- build
variables:
GIT_STRATEGY: fetch
GIT_DEPTH: 3
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"
.docker-env: &docker-env
image: parity/rust-builder:latest
before_script:
- cargo -vV
- rustc -vV
- rustup show
- cargo --version
- sccache -s
only:
- master
- /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
- schedules
- web
- /^[0-9]+$/ # PRs
dependencies: []
interruptible: true
retry:
max: 2
when:
- runner_system_failure
- unknown_failure
- api_failure
tags:
- linux-docker
#### stage: test
cargo-audit:
stage: test
<<: *docker-env
except:
- /^[0-9]+$/
script:
- cargo audit
allow_failure: true
test-linux-stable:
stage: test
<<: *docker-env
variables:
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: -Cdebug-assertions=y
script:
- time cargo test --all --release --locked |
tee output.log
- sccache -s
after_script:
- echo "___Collecting warnings for check_warnings job___"
- awk '/^warning:/,/^$/ { print }' output.log > ${CI_COMMIT_SHORT_SHA}_warnings.log
artifacts:
name: $CI_COMMIT_SHORT_SHA
expire_in: 24 hrs
paths:
- ${CI_COMMIT_SHORT_SHA}_warnings.log
#### stage: build
check_warnings:
stage: build
<<: *docker-env
variables:
GIT_STRATEGY: none
dependencies:
- test-linux-stable
script:
- if [ -s ${CI_COMMIT_SHORT_SHA}_warnings.log ]; then
cat ${CI_COMMIT_SHORT_SHA}_warnings.log;
exit 1;
else
echo "___No warnings___";
fi
allow_failure: true