-
Notifications
You must be signed in to change notification settings - Fork 62
Do not go too deep in Git history #72
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
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0098562
perf: do not go beyond 100 commits reading git history
mohsen1 20406bb
ci: separate bench + stress testing
mohsen1 53af273
chore: make max_git_depth a configuration (read only)
mohsen1 8a5d6ce
ci: install openssl for bench workflow too
mohsen1 44252a2
chore: safer type casting
mohsen1 1793fce
ci: use checkout v4
mohsen1 ce66145
ci: organize ci better to not DRY too much
mohsen1 5cd8c6f
chore: cargo fmt
mohsen1 dc06aae
ci: organize build into its own action
mohsen1 4d93368
refactor: simplify GitHub Actions workflow structure
mohsen1 0749fba
fix: add musl toolchain support for Linux builds
mohsen1 51f7a4f
fix: improve aarch64-musl cross-compilation setup
mohsen1 6ecdcd4
fix: use musl cross-compiler for aarch64-musl builds
mohsen1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,166 @@ | ||
| name: Bench | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| RUST_BACKTRACE: short | ||
| OPENSSL_STATIC: true | ||
| PKG_CONFIG_ALLOW_CROSS: true | ||
|
|
||
| jobs: | ||
| # Ensure various stress tests pass on all platforms | ||
| stress: | ||
| name: Stress | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| # Linux builds using cross | ||
| - os: ubuntu-latest | ||
| target: x86_64-unknown-linux-gnu | ||
| use-cross: true | ||
| artifact_name: yek | ||
| asset_name: yek-x86_64-unknown-linux-gnu.tar.gz | ||
| - os: ubuntu-latest | ||
| target: aarch64-unknown-linux-gnu | ||
| use-cross: true | ||
| artifact_name: yek | ||
| asset_name: yek-aarch64-unknown-linux-gnu.tar.gz | ||
| - os: ubuntu-latest | ||
| target: x86_64-unknown-linux-musl | ||
| use-cross: true | ||
| artifact_name: yek | ||
| asset_name: yek-x86_64-unknown-linux-musl.tar.gz | ||
| - os: ubuntu-latest | ||
| target: aarch64-unknown-linux-musl | ||
| use-cross: true | ||
| artifact_name: yek | ||
| asset_name: yek-aarch64-unknown-linux-musl.tar.gz | ||
|
|
||
| # Native macOS builds | ||
| - os: macos-latest | ||
| target: x86_64-apple-darwin | ||
| artifact_name: yek | ||
| asset_name: yek-x86_64-apple-darwin.tar.gz | ||
| - os: macos-latest | ||
| target: aarch64-apple-darwin | ||
| artifact_name: yek | ||
| asset_name: yek-aarch64-apple-darwin.tar.gz | ||
|
|
||
| # Native Windows builds | ||
| - os: windows-latest | ||
| target: x86_64-pc-windows-msvc | ||
| artifact_name: yek.exe | ||
| asset_name: yek-x86_64-pc-windows-msvc.zip | ||
| - os: windows-latest | ||
| target: aarch64-pc-windows-msvc | ||
| artifact_name: yek.exe | ||
| asset_name: yek-aarch64-pc-windows-msvc.zip | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Checkout VSCode repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: microsoft/vscode | ||
| path: vscode | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Install cross (Linux) | ||
| if: matrix.use-cross | ||
| run: cargo install cross | ||
|
|
||
| - name: Setup Rust (Native builds) | ||
| if: ${{ !matrix.use-cross }} | ||
| uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
| with: | ||
| components: rustfmt,clippy | ||
|
|
||
| - name: Install Rust target | ||
| if: ${{ !matrix.use-cross }} | ||
| run: rustup target add ${{ matrix.target }} | ||
|
|
||
| - name: Build with cross (Linux) | ||
| if: matrix.use-cross | ||
| run: cross build --release --target ${{ matrix.target }} | ||
|
|
||
| - name: Native build (macOS/Windows) | ||
| if: ${{ !matrix.use-cross }} | ||
| run: cargo build --release --target ${{ matrix.target }} | ||
|
|
||
| - name: Install yek | ||
| run: cargo install --path . --all-features | ||
|
|
||
| - name: Run yek | ||
| timeout-minutes: 1 | ||
| run: yek | ||
mohsen1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| benchmark: | ||
| name: Benchmark / ${{ matrix.benchmark_group.name }} | ||
| if: github.event_name == 'pull_request' | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| benchmark_group: | ||
| - group: "SingleFile_ByteMode" | ||
| name: "Single File Byte Mode" | ||
| - group: "SingleFile_ByteMode_Large" | ||
| name: "Single File Byte Mode Large" | ||
| - group: "SingleFile_TokenMode_Large" | ||
| name: "Single File Token Mode Large" | ||
| - group: "MultipleFiles_Small" | ||
| name: "Multiple Files Small" | ||
| - group: "MultipleFiles_Medium" | ||
| name: "Multiple Files Medium" | ||
| - group: "MultipleFiles_Large" | ||
| name: "Multiple Files Large" | ||
| - group: "MultipleFiles_TokenMode" | ||
| name: "Multiple Files Token Mode" | ||
| - group: "CustomConfig" | ||
| name: "Custom Config" | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
mohsen1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| cache-on-failure: true | ||
|
|
||
| - name: Build benchmarks on target branch | ||
| run: | | ||
| git fetch origin ${{ github.base_ref }} | ||
| git checkout ${{ github.base_ref }} | ||
| cargo bench --bench serialization --no-run | ||
| - name: Run benchmark on target branch | ||
| run: cargo bench --bench serialization -- --save-baseline ${{ github.base_ref }} '${{ matrix.benchmark_group.group }}/' | ||
|
|
||
| - name: Build benchmarks on PR branch | ||
| run: | | ||
| git checkout ${{ github.head_ref }} | ||
| cargo bench --bench serialization --no-run | ||
| - name: Compare benchmarks | ||
| run: | | ||
| cargo bench --bench serialization -- --baseline ${{ github.base_ref }} --noise-threshold 2 '${{ matrix.benchmark_group.group }}/' > benchmark_results.md | ||
| echo "## Benchmark Results for ${{ matrix.benchmark_group.name }}" >> $GITHUB_STEP_SUMMARY | ||
| cat benchmark_results.md >> $GITHUB_STEP_SUMMARY | ||
| - name: Upload benchmark results | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: criterion-${{ matrix.benchmark_group.group }}-results | ||
| path: benchmark_results.md | ||
| if-no-files-found: error | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.