Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into xx/s
Browse files Browse the repository at this point in the history
Signed-off-by: MrCroxx <[email protected]>
  • Loading branch information
MrCroxx committed Sep 20, 2024
2 parents ab3c717 + 553a9cb commit bb262f3
Show file tree
Hide file tree
Showing 102 changed files with 1,387 additions and 1,470 deletions.
37 changes: 0 additions & 37 deletions .github/template/generate.sh

This file was deleted.

6 changes: 0 additions & 6 deletions .github/template/main-override.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .github/template/pr-override.yml

This file was deleted.

90 changes: 74 additions & 16 deletions .github/template/template.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
name:
name: "CI"

on:
push:
branches:
- "main"
- "forks/*"
pull_request:
branches:
- "main"
- "v*.*.*-rc"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
RUST_TOOLCHAIN_NIGHTLY: nightly-2024-03-17
RUST_TOOLCHAIN_NIGHTLY: nightly-2024-07-19
CARGO_TERM_COLOR: always
CACHE_KEY_SUFFIX: 20240621
CACHE_KEY_SUFFIX: 20240821

jobs:
misc-check:
Expand All @@ -25,9 +37,6 @@ jobs:
BUF_VERSION: 1.0.0-rc6
- name: Install jq
uses: dcarbone/[email protected]
- 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
Expand All @@ -38,7 +47,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
Expand All @@ -57,6 +66,12 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-${{ env.CACHE_KEY_SUFFIX }}-rust-udeps
- name: Install NASM for aws-lc-rs on Windows
if: runner.os == 'Windows'
uses: ilammy/setup-nasm@v1
- name: Install ninja-build tool for aws-lc-fips-sys on Windows
if: runner.os == 'Windows'
uses: seanmiddleditch/gha-setup-ninja@v5
- name: Install cargo-udeps
if: steps.cache.outputs.cache-hit != 'true'
run: |
Expand All @@ -65,14 +80,49 @@ jobs:
env:
RUSTFLAGS: "--cfg tokio_unstable -Awarnings"
run: |
cargo udeps --all-targets
cargo udeps --all-targets
rust-ffmt-check:
name: rust ffmt check
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt
- 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-ffmt-check
- name: Fastidious Format Check
run: |
cargo fmt --all --check -- --config-path rustfmt.nightly.toml
- name: Hint
if: ${{ failure() }}
run: |-
echo "The ffmt (Fastidious Format Check) test is not a necessary."
echo "It uses unstable features to achieve a better format."
echo "If you want to pass the test, please install the nightly toolchain with \`rustup install nightly\`."
echo "Then run \`make ffmt\`."
rust-test:
name: rust test with codecov
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
rust_toolchain: [stable, 1.77]
os: [ubuntu-latest, macos-latest, windows-latest]
rust_toolchain: [stable, 1.81.0]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
Expand All @@ -96,7 +146,15 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: |
cargo install cargo-sort --locked
- name: Install NASM for aws-lc-rs on Windows
if: runner.os == 'Windows'
uses: ilammy/setup-nasm@v1
- name: Install ninja-build tool for aws-lc-fips-sys on Windows
if: runner.os == 'Windows'
uses: seanmiddleditch/gha-setup-ninja@v5
- name: Run rust cargo-sort check
# https://github.com/DevinR528/cargo-sort/issues/56
if: matrix.os != 'windows-latest'
run: |
cargo sort -w -c
- name: Run rust format check
Expand Down Expand Up @@ -136,18 +194,18 @@ jobs:
cargo llvm-cov --no-report run --features "mtrace,jaeger" --example tail_based_tracing
cargo llvm-cov --no-report run --features "mtrace,ot" --example tail_based_tracing
- name: Run foyer-bench with coverage
if: matrix.os == 'ubuntu-latest'
if: runner.os == 'Linux'
env:
RUST_BACKTRACE: 1
CI: true
run: |
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov
cargo llvm-cov --no-report run --package foyer-bench --bin foyer-bench --features "strict_assertions,sanity" -- --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov --mem 16 --disk 256 --region-size 16 --get-range 1000 --w-rate 1 --r-rate 1 --admission-rate-limit 10 --time 60
cargo llvm-cov --no-report run --package foyer-bench --bin foyer-bench --features "strict_assertions,sanity" -- --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/codecov --mem 16MiB --disk 256MiB --region-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --admission-rate-limit 10MiB --time 60
- name: Generate codecov report
run: |
cargo llvm-cov report --lcov --output-path lcov.info
- uses: codecov/codecov-action@v4
if: matrix.os == 'ubuntu-latest' && matrix.rust_toolchain == 'stable'
if: runner.os == 'Linux' && matrix.rust_toolchain == 'stable'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
Expand Down Expand Up @@ -182,7 +240,7 @@ jobs:
run: |-
cargo build --all --features deadlock
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-storage/deadlock
timeout 2m ./target/debug/foyer-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/deadlock --mem 16 --disk 256 --region-size 16 --get-range 1000 --w-rate 1 --r-rate 1 --admission-rate-limit 10 --time 60
timeout 2m ./target/debug/foyer-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/deadlock --mem 16MiB --disk 256MiB --region-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --admission-rate-limit 10MiB --time 60
asan:
name: run with address saniziter
runs-on: ubuntu-latest
Expand Down Expand Up @@ -220,7 +278,7 @@ jobs:
run: |-
cargo +${{ env.RUST_TOOLCHAIN_NIGHTLY }} build --all --target x86_64-unknown-linux-gnu
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-bench/asan
timeout 2m ./target/x86_64-unknown-linux-gnu/debug/foyer-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/asan --mem 16 --disk 256 --region-size 16 --get-range 1000 --w-rate 1 --r-rate 1 --admission-rate-limit 10 --time 60
timeout 2m ./target/x86_64-unknown-linux-gnu/debug/foyer-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/asan --mem 16MiB --disk 256MiB --region-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --admission-rate-limit 10MiB --time 60
- name: Prepare Artifacts on Failure
if: ${{ failure() }}
run: |-
Expand Down Expand Up @@ -268,7 +326,7 @@ jobs:
run: |-
cargo +${{ env.RUST_TOOLCHAIN_NIGHTLY }} build --all --target x86_64-unknown-linux-gnu
mkdir -p $GITHUB_WORKSPACE/foyer-data/foyer-bench/lsan
timeout 2m ./target/x86_64-unknown-linux-gnu/debug/foyer-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/lsan --mem 16 --disk 256 --region-size 16 --get-range 1000 --w-rate 1 --r-rate 1 --admission-rate-limit 10 --time 60
timeout 2m ./target/x86_64-unknown-linux-gnu/debug/foyer-bench --dir $GITHUB_WORKSPACE/foyer-data/foyer-bench/lsan --mem 16MiB --disk 256MiB --region-size 16MiB --get-range 1000 --w-rate 1MiB --r-rate 1MiB --admission-rate-limit 10MiB --time 60
- name: Prepare Artifacts on Failure
if: ${{ failure() }}
run: |-
Expand Down
Loading

0 comments on commit bb262f3

Please sign in to comment.