Skip to content

Commit bfe146e

Browse files
committed
ci (gitlab-ci): Use gitlab-ci matrix feature.
1 parent a354af2 commit bfe146e

File tree

2 files changed

+29
-229
lines changed

2 files changed

+29
-229
lines changed

.gitlab-ci-matrix.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.gitlab-ci.yml

Lines changed: 29 additions & 181 deletions
Original file line numberDiff line numberDiff line change
@@ -2,198 +2,46 @@ stages:
22
- compile
33
- test
44

5-
compile:rust-stable:
6-
image: liuchong/rustup:stable
5+
compile:
76
stage: compile
7+
image: liuchong/rustup:$RUST_VERSION
88
script:
99
- cargo build
1010
cache:
11-
key: $CI_COMMIT_REF_SLUG:$RUST_KEY
11+
key: "$CI_COMMIT_REF_SLUG:$RUST_VERSION"
1212
paths:
13-
- /root/.cargo/git
14-
- /root/.cargo/registry
1513
- target/
16-
artifacts:
17-
paths:
18-
- target/
19-
variables:
20-
RUST_KEY: rust-stable
21-
22-
compile:rust-stable-musl:
23-
image: liuchong/rustup:stable-musl
24-
stage: compile
25-
script:
26-
- cargo build
27-
cache:
28-
key: $CI_COMMIT_REF_SLUG:$RUST_KEY
29-
paths:
30-
- /root/.cargo/git
31-
- /root/.cargo/registry
32-
- target/
33-
artifacts:
34-
paths:
35-
- target/
36-
variables:
37-
RUST_KEY: rust-stable-musl
38-
39-
compile:rust-beta:
40-
image: liuchong/rustup:stable
41-
stage: compile
42-
script:
43-
- cargo build
44-
cache:
45-
key: $CI_COMMIT_REF_SLUG:$RUST_KEY
46-
paths:
47-
- /root/.cargo/git
48-
- /root/.cargo/registry
49-
- target/
50-
artifacts:
51-
paths:
52-
- target/
53-
variables:
54-
RUST_KEY: rust-beta
55-
56-
compile:rust-beta-musl:
57-
image: liuchong/rustup:stable-musl
58-
stage: compile
59-
script:
60-
- cargo build
61-
cache:
62-
key: $CI_COMMIT_REF_SLUG:$RUST_KEY
63-
paths:
64-
- /root/.cargo/git
65-
- /root/.cargo/registry
66-
- target/
67-
artifacts:
68-
paths:
69-
- target/
70-
variables:
71-
RUST_KEY: rust-beta-musl
72-
73-
compile:rust-nightly:
74-
image: liuchong/rustup:stable
75-
stage: compile
76-
script:
77-
- cargo build
78-
cache:
79-
key: $CI_COMMIT_REF_SLUG:$RUST_KEY
80-
paths:
81-
- /root/.cargo/git
82-
- /root/.cargo/registry
83-
- target/
84-
artifacts:
85-
paths:
86-
- target/
87-
variables:
88-
RUST_KEY: rust-nightly
89-
allow_failure: true
90-
91-
compile:rust-nightly-musl:
92-
image: liuchong/rustup:stable-musl
93-
stage: compile
94-
script:
95-
- cargo build
96-
cache:
97-
key: $CI_COMMIT_REF_SLUG:$RUST_KEY
98-
paths:
99-
- /root/.cargo/git
100-
- /root/.cargo/registry
101-
- target/
102-
artifacts:
103-
paths:
104-
- target/
105-
variables:
106-
RUST_KEY: rust-nightly-musl
107-
allow_failure: true
108-
109-
test:rust-stable:
110-
image: liuchong/rustup:stable
111-
stage: test
112-
dependencies:
113-
- compile:rust-stable
114-
script:
115-
- cargo test
116-
- cargo test --features serde
117-
- cargo test --no-default-features
118-
- cargo test --no-default-features --features std
119-
- cargo test --no-default-features --features alloc
120-
- cargo test --no-default-features --features serde
121-
variables:
122-
RUST_KEY: rust-stable
123-
124-
test:rust-stable-musl:
125-
image: liuchong/rustup:stable-musl
126-
stage: test
127-
dependencies:
128-
- compile:rust-stable-musl
129-
script:
130-
- cargo test
131-
- cargo test --features serde
132-
- cargo test --no-default-features
133-
- cargo test --no-default-features --features std
134-
- cargo test --no-default-features --features alloc
135-
- cargo test --no-default-features --features serde
136-
variables:
137-
RUST_KEY: rust-stable-musl
138-
139-
test:rust-beta:
140-
image: liuchong/rustup:stable
141-
stage: test
142-
dependencies:
143-
- compile:rust-beta
144-
script:
145-
- cargo test
146-
- cargo test --features serde
147-
- cargo test --no-default-features
148-
- cargo test --no-default-features --features std
149-
- cargo test --no-default-features --features alloc
150-
- cargo test --no-default-features --features serde
151-
variables:
152-
RUST_KEY: rust-beta
153-
154-
test:rust-beta-musl:
155-
image: liuchong/rustup:stable-musl
156-
stage: test
157-
dependencies:
158-
- compile:rust-beta-musl
159-
script:
160-
- cargo test
161-
- cargo test --features serde
162-
- cargo test --no-default-features
163-
- cargo test --no-default-features --features std
164-
- cargo test --no-default-features --features alloc
165-
- cargo test --no-default-features --features serde
166-
variables:
167-
RUST_KEY: rust-beta-musl
14+
parallel:
15+
matrix:
16+
- RUST_VERSION:
17+
- stable
18+
- stable-musl
19+
- beta
20+
- beta-musl
21+
- nightly
22+
- nightly-musl
16823

169-
test:rust-nightly:
170-
image: liuchong/rustup:stable
24+
test:
17125
stage: test
172-
dependencies:
173-
- compile:rust-nightly
26+
image: liuchong/rustup:$RUST_VERSION
17427
script:
17528
- cargo test
176-
- cargo test --features serde
17729
- cargo test --no-default-features
178-
- cargo test --no-default-features --features std
17930
- cargo test --no-default-features --features alloc
180-
- cargo test --no-default-features --features serde
181-
variables:
182-
RUST_KEY: rust-nightly
183-
allow_failure: true
184-
185-
test:rust-nightly-musl:
186-
image: liuchong/rustup:stable-musl
187-
stage: test
188-
dependencies:
189-
- compile:rust-nightly-musl
190-
script:
191-
- cargo test
192-
- cargo test --features serde
193-
- cargo test --no-default-features
19431
- cargo test --no-default-features --features std
195-
- cargo test --no-default-features --features alloc
19632
- cargo test --no-default-features --features serde
197-
variables:
198-
RUST_KEY: rust-nightly-musl
199-
allow_failure: true
33+
cache:
34+
key: "$CI_COMMIT_REF_SLUG:$RUST_VERSION"
35+
paths:
36+
- target/
37+
needs:
38+
- compile
39+
parallel:
40+
matrix:
41+
- RUST_VERSION:
42+
- stable
43+
- stable-musl
44+
- beta
45+
- beta-musl
46+
- nightly
47+
- nightly-musl

0 commit comments

Comments
 (0)