arti/.gitlab-ci.yml

218 lines
5.8 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
- deploy
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"
# fs-mistrust doesn't like umask 0
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: "true"
default:
before_script:
# gitlab fetch strategy doesn't reset permissions
- (while [ "$PWD" != / ]; do chmod go-w . && cd ..; done)
2020-12-06 16:01:53 +00:00
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:
- apk add git bash
- ./maint/shellcheck_all
2022-01-28 14:21:28 +00:00
maint-checks:
stage: check
image: debian:stable-slim
script:
2022-08-24 17:05:46 +01:00
- apt-get update && apt-get install -y python3-toml python-is-python3
- ./maint/check_toposort
- ./maint/add_warning --check
2022-08-18 07:09:49 +01:00
- ./maint/check_doc_features
rust-checks:
# This is too slow (and the cacheing of the "cargo build" too flaky) to be a "check"
2020-12-06 00:16:34 +00:00
stage: build
image: rust:latest
script:
- rustup show
- rustup component add rustfmt
2022-06-08 19:11:56 +01:00
- ./maint/via-cargo-install-in-ci cargo-audit cargo-sort cargo-license
- cargo fmt -- --check
- ./maint/check_licenses
- ./maint/cargo_audit
- ./maint/cargo_sort
- ./maint/check_tree
2021-11-12 14:47:27 +00:00
cache:
paths:
- cargo-audit
- cargo-sort
- cargo-license
rust-latest:
stage: build
image: rust:latest
script:
- rustup show
- cargo build --locked --verbose --target x86_64-unknown-linux-gnu
- cargo test --verbose --target x86_64-unknown-linux-gnu
- rustup component add clippy
- rustup show
- cargo clippy --all-features --all-targets -- --cfg ci_arti_stable -D warnings
- cargo build --verbose --release -p arti-bench --target x86_64-unknown-linux-gnu
2021-09-27 16:35:32 +01:00
artifacts:
paths:
- target/x86_64-unknown-linux-gnu/debug/arti
- target/x86_64-unknown-linux-gnu/release/arti-bench
2021-09-27 16:35:32 +01:00
expire_in: 1 hours
tags:
- amd64
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: test
2020-12-06 00:16:34 +00:00
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.)
- (echo; cat clippy-nightly.toml) >>clippy.toml
- cargo clippy --all-features --tests -- --cfg ci_arti_nightly -D clippy::dbg_macro -D clippy::print_stdout -D clippy::print_stderr
- RUSTDOCFLAGS="-Dwarnings --cfg docsrs" cargo doc --all-features --document-private-items --no-deps
2021-09-08 21:15:20 +01:00
tags:
- amd64
coverage:
stage: test
image: rust:latest
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 component add llvm-tools-preview
2022-06-08 19:11:56 +01:00
- ./maint/via-cargo-install-in-ci grcov
# Generate report
- ./maint/with_coverage -f cobertura -o coverage.xml cargo test --verbose --all-features
cache:
paths:
- grcov
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
tags:
- amd64
minimal-versions:
stage: test
image: rust:1.56
script:
- rustup install nightly
- ./maint/downgrade_dependencies
- 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
# If you upgrade this image, also change the one in docker_reproducible_build
image: rust:1.63.0-alpine3.16
script:
- apk add bash
- ./maint/reproducible_build 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 dnsutils
- ./tests/chutney/setup proxy
- ./tests/chutney/test
- ./tests/chutney/stop-arti
- RUST_LOG=debug target/x86_64-unknown-linux-gnu/release/arti-bench -c ./chutney/net/nodes/arti.toml --socks5 127.0.0.1:9008 -o benchmark_results.json
- ./tests/chutney/teardown
artifacts:
paths:
- benchmark_results.json
2021-09-27 16:35:32 +01:00
tags:
- amd64
coverage-aggregated:
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
stage: test
image: rust:latest
needs: []
script:
- apt update && apt install -y tor python3 python3-pip python3-setuptools curl
# install deps for report generation
- pip3 install beautifulsoup4 lxml
- rustup component add llvm-tools-preview
- cp grcov $CARGO_HOME/bin/ || cargo install grcov
- cp $CARGO_HOME/bin/grcov .
# Generate report
- ./maint/coverage all
cache:
paths:
- grcov
artifacts:
paths:
- coverage
tags:
- amd64
pages:
rules:
2022-05-05 21:21:09 +01:00
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_REF_NAME == "main"
stage: deploy
image: debian:stable-slim
script:
- apt update && apt install -y git
# Export report as website, while keeping the existing public page
- git fetch
- git checkout origin/pages -- public/
- mv coverage public/
artifacts:
paths:
- public