save-data 0.1.0

save data safely
Documentation
image: "toru3/rust:latest"

test:
  stage: test
  script:
    - rustup default "$RUST_VERSION"
    # キャッシュの設定
    - if [ "${DISABLE_CACHE:-false}" = "false" ]; then
    -     export CARGO_HOME="$CI_PROJECT_DIR/cargo"
    -     mkdir -p $CARGO_HOME target_cache
    -     ln -s /usr/local/cargo/bin $CARGO_HOME/bin
    -     ln -s /usr/local/cargo/env $CARGO_HOME/env
    -     ln -s target_cache target
    - fi
    # 現在のversionの表示
    - rustup --version && cargo --version
    # Cargo.lock の更新
    - if [ "${USE_MINIMAL_VERSIONS:-false}" = "false" ]; then
    -     time cargo +nightly update
    - else
    -     time cargo +nightly update -Z minimal-versions
    - fi
    - cargo fetch # ソースコードのダウンロード
    - cargo fmt --all --check --verbose # フォーマットチェック
    - cargo clippy --workspace --all-targets $FEATURES -- -D warnings
    - cargo test --workspace $FEATURES
  cache:
    - key: "crates.io-${USE_MINIMAL_VERSIONS}"
      paths:
        - cargo/bin/
        - cargo/registry/index/
        - cargo/registry/cache/
        - cargo/git/db/
    - key: "target-${RUST_VERSION}"
      paths:
        - target_cache/
  artifacts:
    when: always
    paths:
      - lib.xml
      - doc.xml
    reports:
      junit:
        - lib.xml
        - doc.xml
  variables:
    CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
    CARGO_REGISTRIES_CRATES_IO_PROTOCOL: "sparse"
  parallel:
    matrix:
      - RUST_VERSION:
        - "stable"
        - "beta"
        - "1.69.0" # MSRV
        USE_MINIMAL_VERSIONS:
        - "false"
        - "true"
        FEATURES:
        - "--all-features"