Skip to content

chore: add an internal divan fork #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 39 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"crates/cargo-codspeed",
"crates/divan_compat",
"crates/divan_compat/macros",
"crates/divan_compat/divan_fork",
]
resolver = "2"

Expand Down
2 changes: 2 additions & 0 deletions crates/codspeed/src/walltime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ impl RawWallTimeData {
}

/// Entry point called in patched integration to harvest raw walltime data
///
/// `CODSPEED_CARGO_WORKSPACE_ROOT` is expected to be set for this to work
pub fn collect_raw_walltime_results(
scope: &str,
name: String,
Expand Down
2 changes: 1 addition & 1 deletion crates/divan_compat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ keywords = ["codspeed", "benchmark", "divan"]

[dependencies]
codspeed = { path = "../codspeed", version = "=2.8.0-alpha.0" }
divan = { git = "https://github.com/CodSpeedHQ/divan" }
divan = { package = "codspeed-divan-compat-walltime", path = "./divan_fork", version = "=0.1.17" }
codspeed-divan-compat-macros = { version = "=2.8.0-alpha.0", path = './macros' }

[[bench]]
Expand Down
2 changes: 2 additions & 0 deletions crates/divan_compat/divan_fork/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: ['nvzqz']
custom: ['https://paypal.me/nvzqz']
191 changes: 191 additions & 0 deletions crates/divan_compat/divan_fork/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
on: [push, pull_request]

name: CI

env:
CARGO_HOME: ${{ github.workspace }}/.cargo
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings -A unused-imports
RUSTDOCFLAGS: -D warnings
RUST_BACKTRACE: full

jobs:
# Check formatting.
rustfmt:
name: Rustfmt
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update stable --no-self-update
- run: rustc -Vv
- run: cargo fmt --all -- --check

# Build documentation.
rustdoc:
name: Rustdoc
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3.3.2
with:
path: |
${{ env.CARGO_HOME }}
target
key: rustdoc-${{ runner.os }}
- run: rustup update stable --no-self-update
- run: rustc -Vv
- run: cargo rustdoc --all-features -- --document-private-items

# Run linter.
clippy:
name: Clippy
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3.3.2
with:
path: |
${{ env.CARGO_HOME }}
target
key: clippy-${{ runner.os }}
- run: rustup update stable --no-self-update
- run: rustc -Vv
- run: cargo clippy --all --all-targets --all-features

# Run tests in `src/` and `tests/`.
unit-test:
name: Unit Test
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
rust:
- stable
- nightly
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3.3.2
with:
path: |
${{ env.CARGO_HOME }}
target
key: unit-test-${{ runner.os }}-${{ matrix.rust }}
- run: rustup default ${{ matrix.rust }}
- run: rustup update ${{ matrix.rust }} --no-self-update
- run: rustc -Vv
- run: cargo test -p divan -p divan-macros

# Run tests in `src/` and `tests/` using Miri.
unit-test-miri:
name: Unit Test (Miri)
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3.3.2
with:
path: |
${{ env.CARGO_HOME }}
target
key: miri-${{ runner.os }}
- run: rustup default nightly
- run: rustup update nightly --no-self-update
- run: rustup component add miri
- run: rustc -Vv
- run: cargo miri test -p divan -p divan-macros

# Run `examples/` directory as tests.
examples-test:
name: Examples Test
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
rust:
- stable
- nightly
env:
DIVAN_ITEMS_COUNT: 0
DIVAN_BYTES_COUNT: 1
DIVAN_CHARS_COUNT: 2
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3.3.2
with:
path: |
${{ env.CARGO_HOME }}
target
key: examples-test-${{ runner.os }}-${{ matrix.rust }}
- run: rustup default ${{ matrix.rust }}
- run: rustup update ${{ matrix.rust }} --no-self-update
- run: rustc -Vv
- run: cargo test -p examples --all-features --benches

# Run `examples/` directory as benchmarks.
examples-bench:
name: Examples Bench
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ${{ matrix.os }}
env:
# Run each benchmark within 2 seconds.
DIVAN_MAX_TIME: 2
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3.3.2
with:
path: |
${{ env.CARGO_HOME }}
target
key: examples-bench-${{ runner.os }}
- run: rustup update stable --no-self-update
- run: rustc -Vv
- run: cargo bench -p examples --all-features

# Run `internal_benches/` directory as benchmarks.
internals-bench:
name: Internals Bench
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ${{ matrix.os }}
env:
# Run each benchmark within 2 seconds.
DIVAN_MAX_TIME: 2
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3.3.2
with:
path: |
${{ env.CARGO_HOME }}
target
key: internals-bench-${{ runner.os }}
- run: rustup update stable --no-self-update
- run: rustc -Vv
- run: cargo bench -p internal_benches --all-features
Loading