[go: up one dir, main page]

moka 0.11.3

A fast and concurrent cache library inspired by Java Caffeine
Documentation
env:
  # This cfg will prevent to run tests requiring large memory (~8GiB)
  RUSTFLAGS: --cfg circleci
  NUM_CPUS: "2"

linux_arm64_task:
  # Skip the whole task when this is a temporary branch for GitHub merge queue.
  skip: $CIRRUS_BRANCH =~ 'gh-readonly-queue/.*'

  arm_container:
    cpu: $NUM_CPUS
    matrix:
      - image: rust:slim  # docker's official latest rust stable version
      ## Disable jobs for nightly and the MSRV to avoid to hit the concurrency limit.
      # - image: rustlang/rust:nightly-slim # nightly hosted by rustlang
      # - image: rust:1.65.0-slim # MSRV
      # no rust-beta image found in docker hub, won't be tested

  ## Disable caching as there is no Cargo.lock file in Moka repository.
  # registry_cache:
  #   folder: $CARGO_HOME/registry
  #   fingerprint_script: cat Cargo.lock
  # target_cache:
  #   folder: target
  #   fingerprint_script:
  #     - rustc --version
  #     - cat Cargo.lock

  # Install dependencies (native libraries)
  setup_script:
    - apt-get update
    - apt-get install -y libssl-dev pkg-config

  show_cpu_info_script: |
    nproc
    lscpu

  # Show Rust version
  check_version_script: rustc -Vv

  # Downgrade dependencies to minimal versions (Nightly only)
  downgrade_deps_script: |
    # The nightly image has no RUST_VERSION set
    if [ -z "$RUST_VERSION" ]; then
      echo 'Downgrading dependencies to minimal versions'
      cargo update -Z minimal-versions
      cargo update -p openssl --precise 0.10.39
      cargo update -p cc --precise 1.0.61
    else
      echo 'Skipped'
    fi

  # Pin some dependencies to specific versions (MSRV only)
  # pin_deps_script: |
  #   if [ "v$RUST_VERSION" == "v1.65.0" ]; then
  #     echo 'Pinning some dependencies to specific versions'
  #     cargo update -p <crate> --precise <version>
  #   else
  #     echo 'Skipped'
  #   fi

  test_script:
    # Run tests (debug, sync feature)
    - cargo test -j 1 --lib --features sync -- --test-threads=$NUM_CPUS

    # Run tests (release, sync feature)
    - cargo test -j 1 --release --features sync -- --test-threads=$NUM_CPUS

    # Run tests (release, sync feature, thread-pool test for sync::Cache)
    - cargo test --release --lib --features sync sync::cache::tests::enabling_and_disabling_thread_pools -- --exact --ignored

    # Run tests (release, sync feature, thread-pool test for sync::SegmentedCache)
    - cargo test --release --lib --features sync sync::segment::tests::enabling_and_disabling_thread_pools -- --exact --ignored

    # Run tests (sync feature, key lock test for notification)
    - cargo test --release --lib --features sync sync::cache::tests::test_key_lock_used_by_immediate_removal_notifications -- --exact --ignored

    # Run tests (sync feature, drop value after eviction for sync::Cache)
    - cargo test --release --lib --features sync sync::cache::tests::drop_value_immediately_after_eviction -- --exact --ignored

    # Run tests (sync feature, drop value after eviction for sync::SegmentedCache)
    - cargo test --release --lib --features sync sync::segment::tests::drop_value_immediately_after_eviction -- --exact --ignored

    # Run tests (future feature, but no sync feature)
    - cargo test -j 1  --no-default-features --features 'future, atomic64, quanta' -- --test-threads=$NUM_CPUS

    # Run tests (future, sync and logging features)
    - cargo test -j 1  --features 'future, sync, logging' -- --test-threads=$NUM_CPUS

  # before_cache_script:
  #   - rm -rf $CARGO_HOME/registry/index