diff --git a/.gitlab-ci.yaml b/.gitlab-ci.yaml index 23b350fa2c962c8b6d91204536ef6a9a0757efde..f8285d27fabf86e870773633c606d3ed4a4f8320 100644 --- a/.gitlab-ci.yaml +++ b/.gitlab-ci.yaml @@ -1,17 +1,37 @@ image: rust:1.82-alpine stages: - test +cache: &global_cache + key: ${CI_COMMIT_REF_SLUG} + paths: + - .cargo/bin + - .cargo/registry/index + - .cargo/registry/cache + - target/debug/deps + - target/debug/build + policy: pull-push + +variables: + CARGO_HOME: ${CI_PROJECT_DIR}/.cargo lint: stage: test script: - cargo fmt --all --check - cargo clippy --offline --frozen --locked -- -D warnings + cache: + <<: *global_cache + policy: pull test: stage: test script: - - cargo test + - cargo install junitify + - cargo test -- --format=json -Z unstable-options --report-time | junitify --out $CI_PROJECT_DIR/tests/ + artifacts: + when: always + reports: + junit: $CI_PROJECT_DIR/tests/*.xml package: stage: test