Merge #606 #1922
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
pull_request: | |
push: | |
# trying and staging branches are for BORS config | |
branches: | |
- trying | |
- staging | |
- main | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
integration_tests: | |
# Will not run if the event is a PR to bump-meilisearch-v* (so a pre-release PR) | |
# Will still run for each push to bump-meilisearch-v* | |
if: github.event_name != 'pull_request' || !startsWith(github.base_ref, 'bump-meilisearch-v') | |
runs-on: ubuntu-latest | |
name: integration-tests | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: cargo build --verbose | |
- name: Meilisearch (latest version) setup with Docker | |
run: docker run -d -p 7700:7700 getmeili/meilisearch:latest meilisearch --no-analytics --master-key=masterKey | |
- name: Run tests | |
run: cargo test --verbose | |
- name: Cargo check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --workspace --all-targets --all | |
- name: Cargo check no default features | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: --workspace --all-targets --all --no-default-features | |
linter: | |
name: clippy-check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install clippy | |
run: rustup component add clippy | |
- name: Run linter (clippy) | |
# Will fail when encountering warnings | |
run: cargo clippy -- -D warnings | |
formatter: | |
name: rust-format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run formatter | |
run: cargo fmt --all -- --check | |
readme_check: | |
name: readme-check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check the README.md file is up-to-date | |
run: sh scripts/check-readme.sh | |
wasm_build: | |
name: wasm-build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build | |
run: | | |
rustup target add wasm32-unknown-unknown | |
cargo check -p web_app --target wasm32-unknown-unknown | |
yaml-lint: | |
name: Yaml linting check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Yaml lint check | |
uses: ibiqlik/action-yamllint@v3 | |
with: | |
config_file: .yamllint.yml |