Skip to content

chore: remove some uncessary deps (#450) #335

chore: remove some uncessary deps (#450)

chore: remove some uncessary deps (#450) #335

Workflow file for this run

# ================= THIS FILE IS AUTOMATICALLY GENERATED =================
#
# Please run generate.sh and commit after editing the workflow templates.
#
# ========================================================================
name: CI (main)
on:
push:
branches: [main]
workflow_dispatch:
env:
RUST_TOOLCHAIN_NIGHTLY: nightly-2024-03-17
CARGO_TERM_COLOR: always
CACHE_KEY_SUFFIX: 20240426
jobs:
misc-check:
name: misc check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run typos check
uses: crate-ci/typos@master
- name: Install yq
run: |
wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/${BINARY}.tar.gz -O - | tar xz && sudo mv ${BINARY} /usr/bin/yq
env:
YQ_VERSION: v4.16.1
BINARY: yq_linux_amd64
BUF_VERSION: 1.0.0-rc6
- name: Install jq
uses: dcarbone/install-jq-action@v2.0.2
- name: Check if CI workflows are up-to-date
run: |
./.github/template/generate.sh --check
- name: Check if Grafana dashboards are minimized
run: |
./scripts/minimize-dashboards.sh --check
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
rust-udeps:
name: rust udeps test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- name: Cache Cargo home
uses: actions/cache@v4
id: cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ env.CACHE_KEY_SUFFIX }}-rust-udeps
- name: Install cargo-binstall
if: steps.cache.outputs.cache-hit != 'true'
run: |
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
- name: Install cargo-udeps
if: steps.cache.outputs.cache-hit != 'true'
run: |
cargo binstall -y cargo-udeps --locked
- name: Unused Dependencies Check
env:
RUSTFLAGS: "--cfg tokio_unstable -Awarnings"
run: "cargo udeps --all-targets \n"
rust-test:
name: rust test with codecov
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
rust_toolchain: [stable, 1.76]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_toolchain }}
components: rustfmt, clippy, llvm-tools-preview
- name: Cache Cargo home
uses: actions/cache@v4
id: cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ env.CACHE_KEY_SUFFIX }}-rust-test
- name: Install cargo-binstall
if: steps.cache.outputs.cache-hit != 'true'
run: |
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
- name: Install cargo tools
if: steps.cache.outputs.cache-hit != 'true'
run: |
cargo binstall -y cargo-sort
- name: Run rust cargo-sort check
run: |
cargo sort -w -c
- name: Run rust format check
run: |
cargo fmt --all -- --check
- name: Run rust clippy check
run: |
cargo clippy --all-targets --features tokio-console -- -D warnings
cargo clippy --all-targets --features deadlock -- -D warnings
cargo clippy --all-targets -- -D warnings
- if: steps.cache.outputs.cache-hit != 'true'
uses: taiki-e/install-action@cargo-llvm-cov
- if: steps.cache.outputs.cache-hit != 'true'
uses: taiki-e/install-action@nextest
- name: Run rust test with coverage (igored tests)
env:
RUST_BACKTRACE: 1
CI: true
run: |
cargo llvm-cov --no-report nextest --run-ignored ignored-only --no-capture --workspace
- name: Run rust test with coverage
env:
RUST_BACKTRACE: 1
CI: true
run: |
cargo llvm-cov --no-report nextest
- name: Run examples with coverage
env:
RUST_BACKTRACE: 1
CI: true
run: |
cargo llvm-cov --no-report run --example memory
cargo llvm-cov --no-report run --example hybrid
cargo llvm-cov --no-report run --example hybrid_full
- name: Generate codecov report
run: |
cargo llvm-cov report --lcov --output-path lcov.info
- uses: codecov/codecov-action@v4
if: matrix.os == 'ubuntu-latest'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
verbose: true
deadlock:
name: run with single worker thread and deadlock detection
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Cache Cargo home
uses: actions/cache@v4
id: cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ env.CACHE_KEY_SUFFIX }}-deadlock
- name: Run foyer-storage-bench with single worker thread and deadlock detection
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "--cfg tokio_unstable"
RUST_LOG: info
TOKIO_WORKER_THREADS: 1
CI: true
run: |-
cargo build --all --features deadlock
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/deadlock
timeout 2m ./target/debug/foyer-storage-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/deadlock --capacity 256 --file-size 16 --get-range 1000 --w-rate 1 --r-rate 1 --ticket-insert-rate-limit 10 --time 60
asan:
name: run with address saniziter
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN_NIGHTLY }}
- name: Cache Cargo home
uses: actions/cache@v4
id: cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ env.CACHE_KEY_SUFFIX }}-asan
- name: Run Unit Tests With Address Sanitizer
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "-Zsanitizer=address --cfg tokio_unstable"
RUST_LOG: info
CI: true
run: |-
cargo +${{ env.RUST_TOOLCHAIN_NIGHTLY }} test --lib --bins --tests --target x86_64-unknown-linux-gnu -- --nocapture
- name: Run foyer-storage-bench With Address Sanitizer
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "-Zsanitizer=address --cfg tokio_unstable"
RUST_LOG: info
CI: true
run: |-
cargo +${{ env.RUST_TOOLCHAIN_NIGHTLY }} build --all --target x86_64-unknown-linux-gnu
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/asan
timeout 2m ./target/x86_64-unknown-linux-gnu/debug/foyer-storage-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/asan --capacity 256 --file-size 16 --get-range 1000 --w-rate 1 --r-rate 1 --ticket-insert-rate-limit 10 --time 60
- name: Prepare Artifacts on Failure
if: ${{ failure() }}
run: |-
find ./target/x86_64-unknown-linux-gnu/debug/ -type f -executable -name 'foyer*' -print0 | xargs -0 tar czvf artifacts.asan.tgz --transform 's#.*/##'
- name: Upload Artifacts on Failure
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: artifacts.asan.tgz
path: artifacts.asan.tgz
lsan:
name: run with leak saniziter
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN_NIGHTLY }}
- name: Cache Cargo home
uses: actions/cache@v4
id: cache
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ env.CACHE_KEY_SUFFIX }}-lsan
- name: Run Unit Tests With Leak Sanitizer
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "-Zsanitizer=leak --cfg tokio_unstable"
RUST_LOG: info
CI: true
run: |-
cargo +${{ env.RUST_TOOLCHAIN_NIGHTLY }} test --lib --bins --tests --target x86_64-unknown-linux-gnu -- --nocapture
- name: Run foyer-storage-bench With Leak Sanitizer
env:
RUST_BACKTRACE: 1
RUSTFLAGS: "-Zsanitizer=leak --cfg tokio_unstable"
RUST_LOG: info
CI: true
run: |-
cargo +${{ env.RUST_TOOLCHAIN_NIGHTLY }} build --all --target x86_64-unknown-linux-gnu
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/lsan
timeout 2m ./target/x86_64-unknown-linux-gnu/debug/foyer-storage-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-storage-bench/lsan --capacity 256 --file-size 16 --get-range 1000 --w-rate 1 --r-rate 1 --ticket-insert-rate-limit 10 --time 60
- name: Prepare Artifacts on Failure
if: ${{ failure() }}
run: |-
find ./target/x86_64-unknown-linux-gnu/debug/ -type f -executable -name 'foyer*' -print0 | xargs -0 tar czvf artifacts.lsan.tgz --transform 's#.*/##'
- name: Upload Artifacts on Failure
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: artifacts.lsan.tgz
path: artifacts.lsan.tgz
# ================= THIS FILE IS AUTOMATICALLY GENERATED =================
#
# Please run generate.sh and commit after editing the workflow templates.
#
# ========================================================================