-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
96 lines (88 loc) · 3.89 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
# Gitlab servers' CI/CD instructions for vcst.
#
# ## templates for gitlab-ci.yml
#
# See CI/CD template Development guide at: https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
#
# This file was forked from
# - https://gitlab.com/gitlab-org/gitlab/-/blob/aaf4d592f405fafd3f50a5e3da69db3703457360/lib/gitlab/ci/templates/Rust.gitlab-ci.yml
# - pointed to from https://docs.gitlab.com/ee/ci/examples
#
# ## gitlab ci/cd Stages
#
# A pipeline is composed of independent jobs that run scripts, grouped into stages.
# Stages run in sequential order, but jobs within stages run in parallel.
#
# Reference for this YAML file: https://docs.gitlab.com/ee/ci/yaml
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/rust/tags/
# https://doc.rust-lang.org/nightly/clippy/continuous_integration/gitlab.html
image: "rust:latest"
workflow:
auto_cancel:
on_new_commit: interruptible
stages:
- build
- test
- lints
build:cargo:
stage: build
interruptible: true
script:
- rustc --version # Print version info for debugging
- cargo --version # Print version info for debugging
- RUSTFLAGS='-Ddeprecated -Dwarnings' cargo build --workspace --all-targets
test:e2e:
stage: test
needs: ["build:cargo"]
interruptible: true
script:
- rustc --version # Print version info for debugging
- cargo --version # Print version info for debugging
# install jj VCS, per 20241231 instructions at
# https://jj-vcs.github.io/jj/latest/install-and-setup/#cargo-binstall
- cargo install cargo-binstall # dep of jj VCS's isntallation
- cargo binstall --strategies crate-meta-data jj-cli # install jj VCS
- git --version && hg --version && jj --version # vcst/domain-specific debug info
- RUSTFLAGS='-Ddeprecated -Dwarnings' cargo test --locked --all-features --all-targets --workspace --verbose -- --nocapture
test:doc:
stage: lints
needs: ["test:e2e"]
interruptible: true
script:
- rustc --version # Print version info for debugging
- cargo --version # Print version info for debugging
- RUSTFLAGS='-Ddeprecated -Dwarnings' cargo doc --all-features --workspace
test:lint:
stage: lints
needs: ["test:e2e"]
interruptible: true
script:
- rustc --version # Print version info for debugging
- cargo --version # Print version info for debugging
- rustup component add clippy # install clippy
- cargo clippy --version # Print version info for debugging
- cargo clippy --workspace --all -- -W clippy::pedantic -Dwarnings -Ddeprecated
test:cov:
stage: lints
needs: ["test:e2e"]
interruptible: true
script:
- rustc --version # Print version info for debugging
- cargo --version # Print version info for debugging
# install jj VCS, per 20241231 instructions at
# https://jj-vcs.github.io/jj/latest/install-and-setup/#cargo-binstall
- cargo install cargo-binstall # dep of jj VCS's isntallation
- cargo binstall --strategies crate-meta-data jj-cli # install jj VCS
- cargo binstall --strategies crate-meta-data cargo-llvm-cov # install jj VCS
- cargo llvm-cov --version # Print version info for debugging
- git --version && hg --version && jj --version # vcst/domain-specific debug info
# Same as test's steps, but run via code coverage instrumentor:
- RUSTFLAGS='-Ddeprecated -Dwarnings' cargo llvm-cov --all-features --workspace --text # --codecov --output-path codecov.json
# TODO: uncomment below, uncomment --output-path above, delete --text. We
# can do this once we're public. Until then, this will always fail per
# https://github.com/codecov/codecov-action/issues/1671#issuecomment-2486953810
# (and I don't feel like messing with tokens just for the interim).
# - bash <(curl -s https://codecov.io/bash)