-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
92 lines (86 loc) · 2.36 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
default:
image: rust:1.50.0 # update `run-tests`
before_script:
- export PATH=$PATH:/root/.cargo/bin/
- rustup component add clippy
- rustup component add rustfmt
check-formatting:
stage: test
image: rust:latest
script:
- cargo +stable fmt -- --check
only:
changes:
- "src/**/*"
- "examples/**/*"
- Cargo.toml
- .gitlab-ci.yml
refs:
- branches
- merge_requests
run-clippy:
stage: test
image: rust:latest
script:
- cargo +stable clippy --target-dir=../target --examples --no-default-features --features "tls" -- -D warnings
- cargo +stable clippy --target-dir=../target --examples --no-default-features --features "rustls" -- -D warnings
- cargo +stable clippy --target-dir=../target --examples --features "proxy" -- -D warnings
only:
changes:
- "src/**/*"
- "examples/**/*"
- Cargo.toml
- .gitlab-ci.yml
- clippy.toml
refs:
- branches
- merge_requests
check-docs:
stage: test
image: rust:latest
script:
- cargo +stable rustdoc --target-dir=../target -- -D warnings
only:
changes:
- "src/**/*"
- Cargo.toml
- .gitlab-ci.yml
refs:
- branches
- merge_requests
run-tests:
stage: test
script:
- cargo +1.50.0 test --target-dir=../target --features="proxy"
only:
changes:
- "src/**/*"
- "examples/**/*"
- Cargo.toml
- .gitlab-ci.yml
refs:
- branches
- merge_requests
pages:
stage: docs
image: rust:latest
script:
- cargo +stable doc --release --no-deps --target-dir=../target
- mv ../target/doc ./public
- mv ./public/tbot/* ./public/
- cd ./public
- grep -rl "../tbot" * | while read f; do sed -i -e 's#\.\./tbot/#\.\./#g' "$f"; done
- sed -i 's#return\[displayPath,href\]#return\[displayPath,href.replace("\.\./tbot/", "\.\./")\]#g' main.js
artifacts:
paths:
- public
only:
changes:
- "src/**/*"
- Cargo.toml
- .gitlab-ci.yml
refs:
- master
stages:
- test
- docs