-
Notifications
You must be signed in to change notification settings - Fork 24
/
.gitlab-ci.yml
110 lines (103 loc) · 3.24 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
image: rust:latest
before_script:
- echo 'deb http://deb.debian.org/debian buster-backports main contrib non-free' > /etc/apt/sources.list.d/buster-backports.list
- apt-get -qq update
- apt-get install -y libsqlite3-dev curl ipset iperf3 git libssl-dev build-essential libpq-dev sudo python3-pip jq psmisc postgresql postgresql-client kmod wireguard
- curl -fsSL https://get.docker.com -o get-docker.sh
- sh ./get-docker.sh
- service docker start
stages:
- lint
- test
- cross-arch
unit_tests:
stage: test
script:
# unit tests
- "RUST_TEST_THREADS=1 cargo test --all --verbose"
# the lint checks as their own tests for easy failure
# identification
lint_opt_level:
stage: lint
script:
- 'grep -q ''opt-level = "z"'' Cargo.toml'
lint_fmt:
stage: lint
script:
- rustup component add rustfmt
- cargo fmt --all -- --check
# lint_audit:
# stage: lint
# script:
# - "cargo install cargo-audit"
# - "cargo audit"
lint_geiger:
stage: lint
script:
- "cargo install cargo-geiger"
- "cargo geiger"
lint_clippy:
stage: lint
script:
- "rustup component add clippy"
- "cargo clippy --all --all-targets --all-features -- -D warnings"
cross_arch_mips:
stage: cross-arch
variables:
CROSS_TEST_ARGS: "--verbose -p rita_bin --bin rita --features bundle_openssl -- --test-threads=1"
script:
- "cargo install cross"
- "cross test --target mips-unknown-linux-gnu $CROSS_TEST_ARGS"
cross_arch_mips_64:
stage: cross-arch
variables:
CROSS_TEST_ARGS: "--verbose -p rita_bin --bin rita --features bundle_openssl -- --test-threads=1"
script:
- "cargo install cross"
- "cross test --target mips64-unknown-linux-gnuabi64 $CROSS_TEST_ARGS"
cross_arch_arm64:
stage: cross-arch
variables:
CROSS_TEST_ARGS: "--verbose -p rita_bin --bin rita --features bundle_openssl -- --test-threads=1"
script:
- "cargo install cross"
- "cross test --target aarch64-unknown-linux-gnu $CROSS_TEST_ARGS"
# integration_test_basic:
# stage: integration
# script:
# - ./integration-tests/rita.sh
# variables:
# SPEEDTEST_THROUGHPUT: "20"
# SPEEDTEST_DURATION: "15"
# INITIAL_POLL_INTERVAL: 5
# BACKOFF_FACTOR: "1.5"
# VERBOSE: 1
# POSTGRES_USER: postgres
# POSTGRES_BIN: /usr/lib/postgresql/11/bin/postgres
# POSTGRES_CONFIG: /etc/postgresql/11/main/postgresql.conf
# integration_test_docker:
# stage: integration
# script:
# - git archive --format=tar.gz -o $DOCKERFOLDER/rita.tar.gz --prefix=althea_rs/ HEAD
# - pushd $DOCKERFOLDER
# - time docker build -t rita-test .
# - time docker run --name rita-test --privileged -it rita-test
# variables:
# DOCKERFOLDER: integration-tests/container/
# integration_test_backwards_to_master:
# stage: integration
# script:
# - ./integration-tests/rita.sh
# variables:
# REVISION_B: master
# REMOTE_A: ".."
# REMOTE_B: "https://github.com/althea-mesh/althea_rs.git"
# COMPAT_LAYOUT: "inner_ring_old"
# SPEEDTEST_THROUGHPUT: "20"
# SPEEDTEST_DURATION: "15"
# INITIAL_POLL_INTERVAL: 5
# BACKOFF_FACTOR: "1.5"
# VERBOSE: 1
# POSTGRES_USER: postgres
# POSTGRES_BIN: /usr/lib/postgresql/11/bin/postgres
# POSTGRES_CONFIG: /etc/postgresql/11/main/postgresql.conf