diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 7b96e5e..0000000 --- a/.appveyor.yml +++ /dev/null @@ -1,38 +0,0 @@ -environment: - matrix: - - TARGET: x86_64-pc-windows-msvc - TOOLCHAIN: stable - - TARGET: i686-pc-windows-msvc - TOOLCHAIN: stable - - TARGET: x86_64-pc-windows-msvc - TOOLCHAIN: beta - - TARGET: i686-pc-windows-msvc - TOOLCHAIN: beta - - TARGET: x86_64-pc-windows-msvc - TOOLCHAIN: nightly - - TARGET: i686-pc-windows-msvc - TOOLCHAIN: nightly - -install: - - curl -sSf -o rustup-init.exe https://win.rustup.rs/ - - rustup-init.exe -y --default-host %TARGET% --default-toolchain %TOOLCHAIN% - - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin - - choco install make -y - - choco install mingw -y - - refreshenv - - rustc -Vv - - cargo -Vv - - make -v - - gcc -v - -# Disable AppVeyor's build phase, let 'cargo test' take care of the build -build: false - -test_script: - - SET RUST_BACKTRACE=1 - - cargo test --all --target %TARGET% --verbose - - cargo test --all --release --target %TARGET% --verbose - -cache: - - C:\Users\appveyor\.cargo\registry - - target diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d62a8c3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Force LF normalization +* text=auto eol=lf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..532c2eb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,65 @@ +name: CI Build Status + +on: [push, pull_request] + +env: + RUST_BACKTRACE: 1 + # We install a known-to-have-rustfmt version of the nightly toolchain + # in order to run the nightly version of rustfmt, which supports rules + # that we depend upon. When updating, pick a suitable nightly version + # from https://rust-lang.github.io/rustup-components-history/ + # See .rustfmt.toml for the list of unstable features. + KNOWN_TO_HAVE_RUSTFMT: nightly-2020-07-12 + +defaults: + run: + shell: bash + +jobs: + build: + strategy: + matrix: + target: + - { os: ubuntu-latest, host: '' } + - { os: macos-latest, host: '' } + - { os: windows-latest, host: '-x86_64-pc-windows-msvc' } + - { os: windows-latest, host: '-i686-pc-windows-msvc' } + toolchain: [1.45.0, stable, beta, nightly] + + runs-on: ${{ matrix.target.os }} + + steps: + - uses: actions/checkout@v3 + - name: Install Rust toolchain ${{ matrix.toolchain }}${{ matrix.target.host }} on ${{ matrix.target.os }} + run: | + rustup toolchain install ${{ matrix.toolchain }}${{ matrix.target.host }} --profile minimal --component rustfmt clippy + rustup default ${{ matrix.toolchain }}${{ matrix.target.host }} + + - if: ${{ matrix.toolchain == 'nightly' }} + run: | + rustup toolchain install $KNOWN_TO_HAVE_RUSTFMT --profile minimal --component rustfmt clippy + cargo +$KNOWN_TO_HAVE_RUSTFMT fmt --all -- --check + - if: ${{ matrix.toolchain == 'nightly' }} + run: cargo +$KNOWN_TO_HAVE_RUSTFMT clippy --all-features -- -D warnings + env: + CC: clang + + - run: cargo build --verbose + + - name: Test with all features + run: cargo test --all --verbose + + - name: Test with no default features + run: cargo test --lib --no-default-features --verbose + + - name: Test with db-dup-sort + run: cargo test --lib --no-default-features --features "db-dup-sort" --verbose + + - name: Test with db-int-key + run: cargo test --lib --no-default-features --features "db-int-key" --verbose + + - name: Test in release mode + run: cargo test --release --all --verbose + + - name: Run all examples + run: ./run-all-examples.sh diff --git a/.rustfmt.toml b/.rustfmt.toml index 33b9d69..54f5aba 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -1,9 +1,18 @@ +match_block_trailing_comma = true +max_width = 120 +use_small_heuristics = "Off" + +### unstable, nightly-only + +# https://github.com/rust-lang/rustfmt/issues/3349 comment_width = 90 +# https://github.com/rust-lang/rustfmt/issues/3374 force_multiline_blocks = true +# https://github.com/rust-lang/rustfmt/issues/4991 +imports_granularity="Crate" +# https://github.com/rust-lang/rustfmt/issues/3361 imports_layout = "Vertical" -match_block_trailing_comma = true -max_width = 120 -merge_imports = true +# https://github.com/rust-lang/rustfmt/issues/3363 reorder_impl_items = true -use_small_heuristics = "Off" +# https://github.com/rust-lang/rustfmt/issues/3347 wrap_comments = true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 70c80bf..0000000 --- a/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -language: rust -sudo: false - -cache: cargo - -rust: - - 1.45.0 - - stable - - beta - - nightly - -os: - - linux - - osx - -matrix: - allow_failures: - - rust: nightly - fast_finish: true - -before_script: - # We install a known-to-have-rustfmt version of the nightly toolchain - # in order to run the nightly version of rustfmt, which supports rules - # that we depend upon. When updating, pick a suitable nightly version - # from https://rust-lang.github.io/rustup-components-history/ - - rustup toolchain install nightly-2020-07-12 - - rustup component add rustfmt --toolchain nightly-2020-07-12 - - rustup component add clippy --toolchain nightly-2020-07-12 - # Use official clang in order to test out building on osx. - - if [[ "$TRAVIS_OS_NAME" = "osx" ]]; then - brew update; - brew install llvm; - export PATH="/usr/local/opt/llvm/bin:$PATH"; - export LDFLAGS="-L/usr/local/opt/llvm/lib"; - export CPPFLAGS="-I/usr/local/opt/llvm/include"; - fi - -script: - - cargo +nightly-2020-07-12 fmt --all -- --check - - CC="clang" cargo +nightly-2020-07-12 clippy --all-features -- -D warnings - - cargo build --verbose - - export RUST_BACKTRACE=1 - - cargo test --all --verbose - - cargo test --lib --no-default-features --verbose - - cargo test --lib --no-default-features --features "db-dup-sort" --verbose - - cargo test --lib --no-default-features --features "db-int-key" --verbose - - cargo test --release --all --verbose - - ./run-all-examples.sh diff --git a/Cargo.toml b/Cargo.toml index b3512d5..ce46600 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ with-fuzzer-no-link = ["lmdb-rkv/with-fuzzer-no-link"] [dependencies] arrayref = "0.3" bincode = "1.0" -bitflags = "1.1" +bitflags = "~1.2" byteorder = "1" id-arena = "2.2" lazy_static = "1.1" diff --git a/README.md b/README.md index 5399299..bc50d1f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # rkv -[![Travis CI Build Status](https://travis-ci.org/mozilla/rkv.svg?branch=master)](https://travis-ci.org/mozilla/rkv) -[![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/lk936u5y5bi6qafb/branch/master?svg=true)](https://ci.appveyor.com/project/mykmelez/rkv/branch/master) +[![CI Build Status](https://github.com/mozilla/rkv/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/mozilla/rkv/actions/workflows/ci.yml) [![Documentation](https://docs.rs/rkv/badge.svg)](https://docs.rs/rkv/) [![Crate](https://img.shields.io/crates/v/rkv.svg)](https://crates.io/crates/rkv)