-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.gitlab-ci.yml
78 lines (69 loc) · 1.72 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
stages:
- check
- build
variables:
CARGO_HOME: .cargo-home/
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
image: registry.gitlab.com/torizon-platform/ci-container-build:rust-0.0.1
default:
cache:
key: rac-build-$CI_JOB_NAME
untracked: false
when: always
paths:
- target/
- .cargo-home/bin/
- .cargo-home/registry/index/
- .cargo-home/registry/cache/
- .cargo-home/git/db/
lint:
stage: check
allow_failure: true
rules:
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
script:
- sudo chown rust -R .
- cargo clippy -- -Wclippy::pedantic
- cargo fmt --check
test:
stage: check
variables:
RUST_LOG: rac=debug
rules:
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
script:
- sudo chown rust -R .
- sudo apt-get update && sudo apt-get --yes install openssh-server # Needed for spawned sshd test
- cargo test -- --nocapture
.cargo-build:
rules:
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
artifacts:
paths:
- rac-$TARGET_SHORT
script:
- sudo chown rust -R .
- cargo build --target $TARGET --release
- mv target/$TARGET/release/rac rac-$TARGET_SHORT
build x86:
stage: build
extends: .cargo-build
variables:
TARGET: x86_64-unknown-linux-musl
TARGET_SHORT: x86_64-linux-musl
build aarch64:
stage: build
extends: .cargo-build
variables:
TARGET: aarch64-unknown-linux-musl
TARGET_SHORT: aarch65-linux-musl
build armv7:
stage: build
extends: .cargo-build
variables:
TARGET: armv7-unknown-linux-musleabihf
TARGET_SHORT: armv7-linux-musleabihf