Skip to content

Commit dfa6b98

Browse files
authored
change (ci): some optimizations; new image (#560)
1 parent bf8c33c commit dfa6b98

File tree

1 file changed

+41
-22
lines changed

1 file changed

+41
-22
lines changed

.gitlab-ci.yml

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
stages:
22
- checkstyle
33
- test
4+
variables: &default-vars
5+
GIT_STRATEGY: fetch
6+
GIT_DEPTH: 100
7+
CARGO_INCREMENTAL: 0
48

5-
.test_and_build: &test_and_build
9+
.test_and_build: &test_and_build
610
script:
711
- cargo build --all
812
- cargo test --all
@@ -16,37 +20,52 @@ stages:
1620
- web
1721
- /^[0-9]+$/
1822

23+
.docker-env: &docker-env
24+
image: paritytech/ci-linux:production
25+
before_script:
26+
- rustup show
27+
- cargo --version
28+
- sccache -s
29+
variables:
30+
<<: *default-vars
31+
CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}"
32+
retry:
33+
max: 2
34+
when:
35+
- runner_system_failure
36+
- unknown_failure
37+
- api_failure
38+
interruptible: true
39+
tags:
40+
- linux-docker
41+
42+
# check style
43+
checkstyle-linux-stable:
44+
stage: checkstyle
45+
<<: *only
46+
<<: *docker-env
47+
script:
48+
- rustup component add rustfmt
49+
- cargo fmt --all -- --check
50+
allow_failure: true
51+
1952
# test rust stable
2053
test-linux-stable:
21-
image: parity/rust-builder:latest
2254
stage: test
23-
<<: *test_and_build
24-
<<: *only
25-
tags:
26-
- linux-docker
55+
<<: *docker-env
56+
<<: *only
57+
<<: *test_and_build
2758

2859
test-windows-stable:
2960
stage: test
30-
<<: *test_and_build
31-
<<: *only
61+
<<: *test_and_build
62+
<<: *only
3263
tags:
3364
- rust-windows
3465

3566
test-mac-stable:
3667
stage: test
37-
<<: *test_and_build
38-
<<: *only
68+
<<: *test_and_build
69+
<<: *only
3970
tags:
4071
- osx
41-
42-
# check style
43-
checkstyle-linux-stable:
44-
image: parity/rust-builder:latest
45-
stage: checkstyle
46-
script:
47-
- rustup component add rustfmt
48-
- cargo fmt --all -- --check
49-
allow_failure: true
50-
<<: *only
51-
tags:
52-
- linux-docker

0 commit comments

Comments
 (0)