mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
Basic github action for benchmarking
This commit is contained in:
parent
3792941cb1
commit
eaae1202cb
4 changed files with 37 additions and 5 deletions
35
.github/workflows/ci.yml
vendored
Normal file
35
.github/workflows/ci.yml
vendored
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
name: CI
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
pull_request:
|
||||||
|
branches: [master]
|
||||||
|
types: [opened, reopened, synchronize]
|
||||||
|
jobs:
|
||||||
|
Benchmark:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Update rust
|
||||||
|
run: rustup toolchain update stable
|
||||||
|
- name: Run benchmarks
|
||||||
|
run: cargo bench -- -R bencher | tee output.txt
|
||||||
|
- name: Download base benchmark
|
||||||
|
uses: actions/cache@v1
|
||||||
|
with:
|
||||||
|
path: ./cache
|
||||||
|
key: ${{ runner.os }}-benchmark-${{ github.ref }}-${{ github.sha }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-benchmark-${{ github.ref }}-${{ github.sha }}
|
||||||
|
${{ runner.os }}-benchmark-${{ github.ref }}
|
||||||
|
${{ runner.os }}-benchmark
|
||||||
|
- name: Compare benchmarks
|
||||||
|
uses: pksunkara/github-action-benchmark@v1
|
||||||
|
with:
|
||||||
|
tool: cargo
|
||||||
|
output-file-path: output.txt
|
||||||
|
external-data-json-path: ./cache/benchmark-data.json
|
||||||
|
github-token: ${{ github.token }}
|
||||||
|
comment-always: true
|
||||||
|
save-on-pr: false
|
|
@ -26,7 +26,6 @@ branches:
|
||||||
jobs:
|
jobs:
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
- name: Benchmarking
|
|
||||||
- name: Coverage
|
- name: Coverage
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
include:
|
include:
|
||||||
|
@ -46,9 +45,6 @@ jobs:
|
||||||
- cargo clippy --lib --features "yaml unstable" -- -D warnings
|
- cargo clippy --lib --features "yaml unstable" -- -D warnings
|
||||||
- cargo clippy --tests --examples --features "yaml unstable"
|
- cargo clippy --tests --examples --features "yaml unstable"
|
||||||
- cargo fmt -- --check
|
- cargo fmt -- --check
|
||||||
- name: Benchmarking
|
|
||||||
script:
|
|
||||||
- cargo bench
|
|
||||||
- name: Coverage
|
- name: Coverage
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
|
|
|
@ -81,7 +81,7 @@ ansi_term = { version = "0.12.1", optional = true }
|
||||||
regex = "1.0"
|
regex = "1.0"
|
||||||
lazy_static = "1"
|
lazy_static = "1"
|
||||||
version-sync = "0.8"
|
version-sync = "0.8"
|
||||||
criterion = "0.3"
|
criterion = { git = "git://github.com/pksunkara/criterion.rs", version = "0.3" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["suggestions", "color", "vec_map", "derive", "std", "cargo"]
|
default = ["suggestions", "color", "vec_map", "derive", "std", "cargo"]
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#[cfg(feature = "suggestions")]
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
|
|
||||||
// Third Party
|
// Third Party
|
||||||
|
|
Loading…
Reference in a new issue