-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.gitlab-ci.yml
99 lines (86 loc) · 2.26 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
image: "debian:stretch-slim"
stages:
- prepare
- build
- publish
variables:
RUSTUP_HOME: "$CI_PROJECT_DIR/.rustup"
CARGO_HOME: "$CI_PROJECT_DIR/.cargo"
.write_cache:
cache:
key: "$CI_COMMIT_REF_SLUG-rustup"
paths:
- .rustup
- .cargo
.read_cache:
cache:
key: "$CI_COMMIT_REF_SLUG-rustup"
paths:
- .rustup
- .cargo
policy: pull
.toolchain-stable:
extends: .read_cache
before_script:
- apt-get update
- apt-get install -y --no-install-recommends ca-certificates libssl-dev libc6-dev pkg-config gcc
- export PATH="$CARGO_HOME/bin:$PATH"
- rustup default stable
.toolchain-nightly:
extends: .read_cache
allow_failure: true
before_script:
- apt-get update
- apt-get install -y --no-install-recommends ca-certificates libssl-dev libc6-dev pkg-config gcc
- export PATH="$CARGO_HOME/bin:$PATH"
- rustup default nightly
.build-only-when-changes: &build-only-when-changes
only:
changes:
- Cargo.toml
- Cargo.lock
- src/**/*.rs
####### Jobs #######
install-rust:
extends: .write_cache
stage: prepare
script:
- apt-get update
- apt-get install -y --no-install-recommends ca-certificates curl
- curl https://sh.rustup.rs > rustup.sh
- sh rustup.sh -y --default-host x86_64-unknown-linux-gnu
- export PATH="$CARGO_HOME/bin:$PATH"
- rustup install stable
- rustup install nightly
<<: *build-only-when-changes
build-stable-no-default-features:
extends: .toolchain-stable
stage: build
script:
- cargo test --tests --no-default-features
<<: *build-only-when-changes
build-stable-features-rich_presence:
extends: .toolchain-stable
stage: build
script:
- cargo test --tests --no-default-features
--features "rich_presence"
- cargo test --no-default-features
--features "rich_presence"
--example "discord_presence"
--example "discord_presence_subscribe"
<<: *build-only-when-changes
build-nightly:
extends: .toolchain-nightly
stage: build
script:
- cargo test --tests
- cargo test --examples
<<: *build-only-when-changes
deploy-crates-io:
extends: .toolchain-stable
stage: publish
script:
- cargo publish --token $CRATES_IO_API_TOKEN
only:
- tags@valeth/discord-rpc-client.rs