Avoid to use Qrels and Run (#16) #33
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: build | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v*.*.*" | |
pull_request: | |
branches: | |
- main | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
name: Check on ${{ matrix.rust }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: | |
- 1.65.0 # MSRV | |
- stable | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install ${{ matrix.rust }} | |
run: | | |
rustup toolchain install ${{ matrix.rust }} --profile minimal --component rustfmt,clippy | |
rustup default ${{ matrix.rust }} | |
- name: Run cargo check | |
run: cargo check | |
- name: Run cargo check (all) | |
# MSRV should be ignored for dev-dependencies. | |
continue-on-error: ${{ matrix.rust != 'stable' }} | |
run: cargo check --all | |
- name: Run cargo check (all, serde) | |
# MSRV should be ignored for dev-dependencies. | |
continue-on-error: ${{ matrix.rust != 'stable' }} | |
run: cargo check --all --features serde | |
- name: Run cargo fmt | |
run: cargo fmt --all -- --check | |
- name: Run cargo clippy (all, serde) | |
# Run clippy only on stable to ignore unreasonable old warnings. | |
continue-on-error: ${{ matrix.rust != 'stable' }} | |
run: cargo clippy --all --features serde -- -D warnings -W clippy::nursery | |
- name: Run cargo test | |
# MSRV should be ignored for dev-dependencies. | |
continue-on-error: ${{ matrix.rust != 'stable' }} | |
run: cargo test --release | |
- name: Run cargo doc | |
run: RUSTDOCFLAGS="--html-in-header katex.html" cargo doc --no-deps | |
- name: Run cargo example | |
# MSRV should be ignored for dev-dependencies. | |
continue-on-error: ${{ matrix.rust != 'stable' }} | |
run: | | |
cargo run --release --example from_json --features serde | |
cargo run --release --example from_trec | |
cargo run --release --example paired_bootstrap_test | |
cargo run --release --example simple | |
correctness-test: | |
name: Correctness test against trec_eval | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install stable | |
run: | | |
rustup toolchain install stable --profile minimal | |
rustup default stable | |
- name: Install Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Build elinor-evaluate | |
run: cargo build --release -p elinor-evaluate | |
- name: Run correctness test | |
run: | | |
./correctness-test/prepare_trec_eval.sh | |
./correctness-test/compare_with_trec_eval.py trec_eval-9.0.8 target/release |