stages:
- build
- test
- quality
- deploy
cache:
paths:
- .cargo
- target
variables:
CARGO_HOME: ${CI_PROJECT_DIR}/.cargo
compile:
stage: build
image: rust:1-bullseye
script:
- cargo build --tests --release # Build all of the tests in release mode
- cargo build --release # Build the binaries
unit-tests:
stage: test
image: rust:1-bullseye
variables:
RUST_BACKTRACE: 1
script:
- cargo test --lib --release # Unit tests
mission-design-integration-tests:
stage: test
image: rust:1-bullseye
variables:
RUST_BACKTRACE: 1
script:
- cargo test cosmic --release
- cargo test mission_design --release
- cargo test monte_carlo --release
propulsion-integration-tests:
stage: test
image: rust:1-bullseye
variables:
RUST_BACKTRACE: 1
script:
- cargo test closedloop_single --release
- cargo test closedloop_multi --release
- cargo test schedule --release
propagation-integration-tests:
stage: test
image: rust:1-bullseye
variables:
RUST_BACKTRACE: 1
script:
- cargo test stopcond --release
- cargo test stm --release
- cargo test events --release
- cargo test targeter --release
- cargo test trajectory --release
orbit-determination-integration-tests:
stage: test
image: rust:1-bullseye
variables:
RUST_BACKTRACE: 1
script:
- cargo test orbit_determination --release
allow_failure: true
scenario-tests:
image: rust:1-bullseye
script:
- cargo run --release -- data/simple-scenario.toml --all
# Check that when we do a unit conversion it's correct
# NOTE: We don't do that with km output because the unit conversion leads to some rounding issues
- diff ./data/scenario-run-cm.csv ./data/scenario-run-m.csv
- cargo run --release -- data/simple-od-scenario.toml
- cargo run --release -- "data/od_validation/*" -a
- cargo run --release -- data/iss-example.toml -s iss_cond
pages:
stage: deploy
image: rust:1-bullseye
variables:
CARGO_HOME: $CI_PROJECT_DIR/cargo
cache:
paths:
- target/
- cargo/
before_script:
- rustup component add rustfmt
script:
- mkdir -p public
- cargo doc --verbose --no-deps --release
- cp -R target/doc/* ./public/
- cp docs/index.html ./public/
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: always
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
when: never
fmt_and_lint:
stage: quality
image: rust:1-bullseye
script:
- rustup component add rustfmt
- cargo fmt -- --check
- rustup component add clippy
- cargo clippy
audit:
stage: quality
image: rust:1-bullseye
script:
- cargo install cargo-audit
- cargo audit
allow_failure: true