Skip to content

refactor: handle repair requests and replies on separate networks and tokio tasks #852

refactor: handle repair requests and replies on separate networks and tokio tasks

refactor: handle repair requests and replies on separate networks and tokio tasks #852

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Cache build files
id: cache-build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Cache downloaded data
id: cache-data
uses: actions/cache@v4
with:
path: ./data
key: data-v1 # Change this if the dataset version changes
- name: Download data if needed
run: |
if [ ! -f data/dataset.ok ]; then
./download_data.sh
touch data/dataset.ok
fi
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Install tools
uses: taiki-e/install-action@v2
with:
tool: nextest,cargo-llvm-cov,cargo-machete
- name: Build (debug)
run: cargo build --all-targets --verbose
- name: Build (release)
run: cargo build --all-targets --release --verbose
- name: Linting (clippy)
run: cargo clippy --all-targets --all-features -- -Dwarnings
- name: Unused dependencies
run: cargo machete
- name: Run tests
run: ./test.sh ci
# test coverage
- name: Collect coverage data
run: cargo llvm-cov --lcov --workspace --ignore-filename-regex='(benches|src/bin|src/main.rs)' --release --output-path lcov.info nextest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
rustfmt:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: actions/checkout@v4
- name: Install Rust (nightly + rustfmt)
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt
profile: minimal
- name: Run rustfmt
run: cargo +nightly fmt --all -- --check