/
.gitlab-ci.yml
91 lines (83 loc) · 1.7 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
image: "rust:latest"
stages:
- "test"
- "build"
- "publish"
# Prepare
.prepare_stable:
script:
- echo 'Running stable preparation...'
- rustup update
- rustup default > .toolchain
cache:
- key:
files:
- "Cargo.lock"
paths:
- target
.prepare_nightly:
script:
- echo 'Running nightly preparation...'
- rustup install nightly
- rustup default nightly
- rustup default > .toolchain
cache:
- key:
files:
- "Cargo.lock"
paths:
- target
# Test
test_stable:
stage: "test"
extends: ".prepare_stable"
script:
- echo 'Running stable checks...'
- cargo check
- echo 'Running stable tests...'
- cargo test
- echo 'Running stable clippy...'
- rustup component add clippy-preview
- cargo clippy
test_nightly:
stage: "test"
extends: ".prepare_nightly"
script:
- echo 'Running nightly checks...'
- cargo check
- echo 'Running nightly tests...'
- cargo test
- echo 'Running nightly clippy...'
- rustup component add clippy-preview
- cargo clippy
# Build
build_stable:
stage: "build"
extends: ".prepare_stable"
needs:
- "test_stable"
script:
- echo 'Building stable release...'
- cargo build --release
artifacts:
name: "kyanite"
paths:
- "target/release/kyanite"
build_nightly:
stage: "build"
extends: ".prepare_nightly"
needs:
- "test_nightly"
script:
- echo 'Building nightly release...'
- cargo build --release
# Publish
crates_io:
stage: "publish"
needs:
- "build_stable"
script:
- echo 'Publishing to crates.io...'
- cargo publish --token "$CRATES_IO_API_TOKEN"
only:
- tags@lu-ci/kyanite