-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
115 lines (108 loc) · 2.42 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
variables:
RUST_BACKTRACE: "1"
stages:
- test
- build
- deploy
rust-latest:
stage: test
cache:
key: latest
paths:
- target/
image: rust:latest
script:
- rustup component add rustfmt
- rustup component add clippy
- cargo build --verbose --locked
- cargo test --verbose --workspace
- cargo fmt --all --verbose -- --check
- cargo clippy --workspace --verbose -- -D clippy::all
rules:
- if: $CI_PIPELINE_SOURCE != "schedule"
changes:
- src/**/*
- crates/**/*
- Cargo.toml
- Cargo.lock
- build.rs
- .gitlab-ci.yml
rust-minimal:
stage: test
cache:
key: latest
paths:
- target/
image: rust:1.81
script:
- rustup component add rustfmt
- rustup component add clippy
- cargo build --verbose --locked
- cargo test --verbose --workspace
rules:
- if: $CI_PIPELINE_SOURCE != "schedule"
changes:
- src/**/*
- crates/**/*
- Cargo.toml
- Cargo.lock
- build.rs
- .gitlab-ci.yml
rust-nightly:
allow_failure: true
stage: test
image: rustlang/rust:nightly
script:
- cargo build --verbose --locked
- rustup component add clippy
- cargo test --verbose
- cargo clippy --workspace --verbose -- -D clippy::all
cache:
key: nightly
paths:
- target/
rules:
- if: $CI_RUN_NIGHTLY_COMPILER == "True"
release-linux:
stage: build
image: rust:latest
script:
- cargo build --release --locked --verbose
- ./scripts/create-realease-tarbal.sh
cache:
key: release-linux
paths:
- target/
artifacts:
paths:
- linux-build/
only:
- tags
cargo-audit:
stage: test
image: alpine:latest
script:
- apk add cargo-audit
- cargo-audit audit --deny warnings
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
pages:
stage: deploy
image: ubuntu:latest
variables:
MDBOOK_VERSION: "0.4.44"
script:
- apt update
- apt install wget -y
- wget https://github.com/rust-lang/mdBook/releases/download/v"$MDBOOK_VERSION"/mdbook-v"$MDBOOK_VERSION"-x86_64-unknown-linux-gnu.tar.gz
- tar xvzf mdbook-v"$MDBOOK_VERSION"-x86_64-unknown-linux-gnu.tar.gz
- ./mdbook build docs/ -d ../public
- find public -type f -exec gzip -9 -f -k {} \;
artifacts:
paths:
- public/
rules:
- if: $CI_PIPELINE_SOURCE != "schedule"
changes:
- docs/**/*
- .gitlab-ci.yml