mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-25 03:25:06 +08:00
2e4d4b398d
Bumps [Swatinem/rust-cache](https://github.com/swatinem/rust-cache) from 2.7.1 to 2.7.5. - [Release notes](https://github.com/swatinem/rust-cache/releases) - [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md) - [Commits](https://github.com/swatinem/rust-cache/compare/v2.7.1...v2.7.5) --- updated-dependencies: - dependency-name: Swatinem/rust-cache dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
174 lines
5.4 KiB
YAML
174 lines
5.4 KiB
YAML
name: Test suite
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
# Everyday at 5:00am
|
|
- cron: '0 5 * * *'
|
|
pull_request:
|
|
push:
|
|
# trying and staging branches are for Bors config
|
|
branches:
|
|
- trying
|
|
- staging
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUST_BACKTRACE: 1
|
|
RUSTFLAGS: "-D warnings"
|
|
|
|
jobs:
|
|
test-linux:
|
|
name: Tests on ubuntu-20.04
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
# Use ubuntu-20.04 to compile with glibc 2.28
|
|
image: ubuntu:20.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install needed dependencies
|
|
run: |
|
|
apt-get update && apt-get install -y curl
|
|
apt-get install build-essential -y
|
|
- name: Setup test with Rust stable
|
|
uses: dtolnay/rust-toolchain@1.79
|
|
- name: Cache dependencies
|
|
uses: Swatinem/rust-cache@v2.7.5
|
|
- name: Run cargo check without any default features
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --locked --release --no-default-features --all
|
|
- name: Run cargo test
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --locked --release --all
|
|
|
|
test-others:
|
|
name: Tests on ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [macos-13, windows-2022]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Cache dependencies
|
|
uses: Swatinem/rust-cache@v2.7.5
|
|
- uses: dtolnay/rust-toolchain@1.79
|
|
- name: Run cargo check without any default features
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --locked --release --no-default-features --all
|
|
- name: Run cargo test
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --locked --release --all
|
|
|
|
test-all-features:
|
|
name: Tests almost all features
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
# Use ubuntu-20.04 to compile with glibc 2.28
|
|
image: ubuntu:20.04
|
|
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install needed dependencies
|
|
run: |
|
|
apt-get update
|
|
apt-get install --assume-yes build-essential curl
|
|
- uses: dtolnay/rust-toolchain@1.79
|
|
- name: Run cargo build with almost all features
|
|
run: |
|
|
cargo build --workspace --locked --release --features "$(cargo xtask list-features --exclude-feature cuda)"
|
|
- name: Run cargo test with almost all features
|
|
run: |
|
|
cargo test --workspace --locked --release --features "$(cargo xtask list-features --exclude-feature cuda)"
|
|
|
|
test-disabled-tokenization:
|
|
name: Test disabled tokenization
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: ubuntu:20.04
|
|
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install needed dependencies
|
|
run: |
|
|
apt-get update
|
|
apt-get install --assume-yes build-essential curl
|
|
- uses: dtolnay/rust-toolchain@1.79
|
|
- name: Run cargo tree without default features and check lindera is not present
|
|
run: |
|
|
if cargo tree -f '{p} {f}' -e normal --no-default-features | grep -qz lindera; then
|
|
echo "lindera has been found in the sources and it shouldn't"
|
|
exit 1
|
|
fi
|
|
- name: Run cargo tree with default features and check lindera is pressent
|
|
run: |
|
|
cargo tree -f '{p} {f}' -e normal | grep lindera -qz
|
|
|
|
# We run tests in debug also, to make sure that the debug_assertions are hit
|
|
test-debug:
|
|
name: Run tests in debug
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
# Use ubuntu-20.04 to compile with glibc 2.28
|
|
image: ubuntu:20.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Install needed dependencies
|
|
run: |
|
|
apt-get update && apt-get install -y curl
|
|
apt-get install build-essential -y
|
|
- uses: dtolnay/rust-toolchain@1.79
|
|
- name: Cache dependencies
|
|
uses: Swatinem/rust-cache@v2.7.5
|
|
- name: Run tests in debug
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --locked --all
|
|
|
|
clippy:
|
|
name: Run Clippy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: dtolnay/rust-toolchain@1.79
|
|
with:
|
|
profile: minimal
|
|
components: clippy
|
|
- name: Cache dependencies
|
|
uses: Swatinem/rust-cache@v2.7.5
|
|
- name: Run cargo clippy
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: clippy
|
|
args: --all-targets -- --deny warnings
|
|
|
|
fmt:
|
|
name: Run Rustfmt
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: dtolnay/rust-toolchain@1.79
|
|
with:
|
|
profile: minimal
|
|
toolchain: nightly-2024-07-09
|
|
override: true
|
|
components: rustfmt
|
|
- name: Cache dependencies
|
|
uses: Swatinem/rust-cache@v2.7.5
|
|
- name: Run cargo fmt
|
|
# Since we never ran the `build.rs` script in the benchmark directory we are missing one auto-generated import file.
|
|
# Since we want to trigger (and fail) this action as fast as possible, instead of building the benchmark crate
|
|
# we are going to create an empty file where rustfmt expects it.
|
|
run: |
|
|
echo -ne "\n" > crates/benchmarks/benches/datasets_paths.rs
|
|
cargo fmt --all -- --check
|