arti/.gitlab-ci.yml

141 lines
3.7 KiB
YAML
Raw Normal View History

2020-12-06 00:16:34 +00:00
stages:
- check
2020-12-06 00:16:34 +00:00
- build
2021-09-27 16:35:32 +01:00
- test
2020-12-06 00:16:34 +00:00
2020-12-06 16:01:53 +00:00
variables:
# We don't need Husky to install the Git hooks for CI.
CARGO_HUSKY_DONT_INSTALL_HOOKS: "true"
check-editorconfig:
stage: check
image: mstruebing/editorconfig-checker
script:
- ec
2022-01-28 14:21:28 +00:00
shellcheck:
stage: check
2022-01-28 14:21:28 +00:00
image: koalaman/shellcheck-alpine
script:
- ./maint/shellcheck_all.sh
2022-01-28 14:21:28 +00:00
2020-12-06 00:16:34 +00:00
rust-latest:
stage: build
image: rust:latest
script:
- rustup show
- cargo build --verbose --target x86_64-unknown-linux-gnu
- cargo test --verbose --target x86_64-unknown-linux-gnu
- rustup component add clippy rustfmt
- rustup show
2021-12-09 15:42:36 +00:00
- cargo clippy --all-features --all-targets -- -D warnings
- cargo fmt -- --check
2021-11-12 14:47:27 +00:00
- cp cargo-audit $CARGO_HOME/bin/ || cargo install cargo-audit
- ./maint/cargo_audit.sh
2021-11-12 14:47:27 +00:00
- cp $CARGO_HOME/bin/cargo-audit .
2021-09-08 21:15:20 +01:00
tags:
- amd64
2021-11-12 14:47:27 +00:00
cache:
paths:
- cargo-audit
2021-09-27 16:35:32 +01:00
artifacts:
paths:
- target/x86_64-unknown-linux-gnu/debug/arti
expire_in: 1 hours
2020-12-06 00:16:34 +00:00
rust-latest-async-std-rustls:
stage: build
image: rust:latest
script:
- rustup show
- rustup component add clippy
- cd crates/arti-client && cargo clippy --no-default-features --features=async-std,rustls
2021-09-08 21:15:20 +01:00
tags:
- amd64
2020-12-06 00:16:34 +00:00
rust-nightly:
stage: build
image: rustlang/rust:nightly
allow_failure: true
script:
- rustup show
- cargo build --verbose --target x86_64-unknown-linux-gnu --all-features
- cargo test --verbose --target x86_64-unknown-linux-gnu --all-features
- rustup component add clippy
# We check these extra warnings on CI only, since we don't want to forbid them while developing.
# The --cfg allows us to write #![cfg_attr(ci_arti_nightly, allow(clippy::needless_borrow))]
# and similar, for when nightly clippy has false positives. (There is no builtin
# cfg flag for nightly, and a cargo "feature" would be bad with --all-features.)
- cargo clippy --all-features --tests -- --cfg ci_arti_nightly -D clippy::dbg_macro -D clippy::print_stdout -D clippy::print_stderr
2022-01-28 16:44:32 +00:00
- RUSTDOCFLAGS="-Dwarnings" cargo doc --all-features --document-private-items
2021-09-08 21:15:20 +01:00
tags:
- amd64
coverage:
stage: test
image: rust:latest
variables:
RUSTFLAGS: "-Zinstrument-coverage"
2022-01-07 06:07:03 +00:00
LLVM_PROFILE_FILE: "arti-%p-%m.profraw"
script:
2022-01-27 05:48:11 +00:00
- apt-get update && apt-get install -y python3-pip python3-setuptools
- pip3 install beautifulsoup4 lxml
- rustup toolchain add nightly
- rustup default nightly
- rustup component add llvm-tools-preview
- cargo install grcov
# Generate report
- ./maint/with_coverage.sh cargo test --verbose --all-features
2022-01-28 00:28:06 +00:00
- ./maint/with_coverage.sh -f cobertura -o coverage.xml -c true
artifacts:
paths:
- 'coverage'
reports:
cobertura: coverage.xml
minimal-versions:
stage: test
image: rust:1.53
script:
- rustup install nightly
- ./maint/downgrade_dependencies.sh
- cargo build --verbose --target x86_64-unknown-linux-gnu --all-features
- cargo test --verbose --target x86_64-unknown-linux-gnu --all-features
tags:
- amd64
build-repro:
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG != null
stage: build
image: rust:1.54.0-alpine3.14
script:
2021-09-19 20:38:07 +01:00
- ./maint/reproducible_build.sh linux windows macos
artifacts:
paths:
- arti-linux
- arti-windows.exe
- arti-macos
expire_in: 1 day
cache:
paths:
- osxcross/target
2021-08-31 17:24:49 +01:00
tags:
- TPA
2021-09-08 21:15:20 +01:00
- amd64
2021-09-27 16:35:32 +01:00
integration:
stage: test
image: debian:stable-slim
script:
- apt update
- apt install -y tor git python3 curl
2021-09-28 18:36:00 +01:00
- ./tests/chutney/setup.sh
2021-09-27 16:35:32 +01:00
- curl http://example.com -vs --socks5-hostname 127.0.0.1:9150 -o /dev/null
2021-09-28 18:36:00 +01:00
- ./tests/chutney/teardown.sh
2021-09-27 16:35:32 +01:00
tags:
- amd64