-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy path.gitlab-ci.yml
101 lines (88 loc) · 1.56 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
image: archlinux:latest
stages:
- build
- docs
- test
variables:
CARGO_HOME: "${CI_PROJECT_DIR}/.cargo"
PACMAN_CACHE: "${CI_PROJECT_DIR}/.pacman/pkg"
cache:
paths:
- .cargo/
- target/
- .pacman/pkg
key: ${CI_JOB_NAME}
before_script:
- install -d "${PACMAN_CACHE}"
- pacman -Syu --needed --noconfirm --cachedir "${PACMAN_CACHE}" rust gcc pkg-config make scdoc
- rustc --version
- cargo --version
build:
stage: build
needs: []
script:
- cargo build --release
artifacts:
paths:
- target
expire_in: 1 day
man:
stage: docs
needs: []
script:
- make docs
artifacts:
paths:
- contrib/man/arch-audit.1
expire_in: 1 day
completions:
stage: docs
needs:
- build
script:
- make completions
artifacts:
paths:
- target/completion/
expire_in: 1 day
format:
stage: test
needs: []
script:
- cargo fmt --all -- --check
clippy:
stage: test
needs:
- build
script:
- find . -name '*.rs' -exec touch {} +
- cargo clippy --all -- -D warnings
check:
stage: test
needs:
- build
script:
- cargo check --all --verbose --release
test:
stage: test
needs:
- build
script:
- cargo test --all --verbose --release
install:
stage: test
needs:
- build
script:
- install -d destdir
- make DESTDIR=destdir PREFIX=/usr install
artifacts:
paths:
- destdir
expire_in: 1 day
audit:
stage: test
needs: []
script:
- pacman -Syu --needed --noconfirm --cachedir "${PACMAN_CACHE}" cargo-audit
- cargo audit