This repository has been archived by the owner on Mar 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.gitlab-ci.yml
126 lines (106 loc) · 3.17 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
116
117
118
119
120
121
122
123
124
125
126
image: ekidd/rust-musl-builder:stable-openssl11
stages:
- build-and-test
- acceptance-test
test-x86_64-unknown-linux-musl-debug:
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- target/
- cargo-home/
stage: build-and-test
script:
- cp -r $HOME/.cargo cargo-home
- export CARGO_HOME=$PWD/cargo-home
- rustc --version && cargo --version
- cargo build --all --all-targets
- cargo test --all --verbose
build-x86_64-unknown-linux-musl-release:
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- target/
- cargo-home/
stage: build-and-test
artifacts:
name: "gerritbot-$CI_JOB_NAME"
paths:
- target/x86_64-unknown-linux-musl/release/gerritbot
- target/x86_64-unknown-linux-musl/release/examples/gerritbot-console
script:
- cp -r $HOME/.cargo cargo-home
- export CARGO_HOME=$PWD/cargo-home
- |
cargo build \
--release \
--target x86_64-unknown-linux-musl \
--package gerritbot \
--bin gerritbot \
--example gerritbot-console
build-armv7-unknown-linux-gnueabihf-release:
image: japaric/armv7-unknown-linux-gnueabihf
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- cargo-home/
stage: build-and-test
artifacts:
name: "gerritbot-$CI_JOB_NAME"
paths:
- target/armv7-unknown-linux-gnueabihf/release/gerritbot
before_script:
- apt-get install -y curl strace
- useradd -s /bin/bash rust
- mkdir -p /home/rust
- "chown rust: /home/rust"
- |
su - rust <<RUST
set -ex
curl -o rustup-init https://sh.rustup.rs
sh rustup-init -y
source ~/.cargo/env
rustup target add armv7-unknown-linux-gnueabihf
RUST
script:
- |
su - rust <<RUST
set -ex
source ~/.cargo/env
cd $CI_PROJECT_DIR
cp -r ~/.cargo cargo-home
export \
CARGO_HOME=$PWD/cargo-home \
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=$CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER \
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER=$CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER \
CC_armv7_unknown_linux_gnueabihf=$CC_armv7_unknown_linux_gnueabihf \
OPENSSL_DIR=$OPENSSL_DIR \
OPENSSL_INCLUDE_DIR=$OPENSSL_INCLUDE_DIR \
OPENSSL_LIB_DIR=$OPENSSL_LIB_DIR \
QEMU_LD_PREFIX=$QEMU_LD_PREFIX \
RUST_TEST_THREADS=1 \
CI_COMMIT_SHA=$CI_COMMIT_SHA
env
rm -rf target
cargo build \
--release \
--target armv7-unknown-linux-gnueabihf \
--package gerritbot \
--bin gerritbot
RUST
acceptance-test-x86_64-unknown-linux-musl-release:
stage: acceptance-test
dependencies:
- build-x86_64-unknown-linux-musl-release
before_script:
- sudo apt-get update
- sudo apt-get install -y openjdk-8-jre-headless python3 python3-pip
- sudo pip3 install -r requirements.txt
script:
- ./testing/run-gerrit.sh &
- |
env PYTHONIOENCODING=utf-8 \
behave -v \
--color \
-D gerrit_start_timeout=60 \
-D gerritbot_message_timeout=1 \
-D gerritbot_executable=target/x86_64-unknown-linux-musl/release/examples/gerritbot-console