Basic github action for benchmarking

This commit is contained in:
Pavan Kumar Sunkara 2020-03-05 02:20:05 +01:00
parent 3792941cb1
commit eaae1202cb
4 changed files with 37 additions and 5 deletions

35
.github/workflows/ci.yml vendored Normal file
View 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

View file

@ -26,7 +26,6 @@ branches:
jobs:
allow_failures:
- rust: nightly
- name: Benchmarking
- name: Coverage
fast_finish: true
include:
@ -46,9 +45,6 @@ jobs:
- cargo clippy --lib --features "yaml unstable" -- -D warnings
- cargo clippy --tests --examples --features "yaml unstable"
- cargo fmt -- --check
- name: Benchmarking
script:
- cargo bench
- name: Coverage
addons:
apt:

View file

@ -81,7 +81,7 @@ ansi_term = { version = "0.12.1", optional = true }
regex = "1.0"
lazy_static = "1"
version-sync = "0.8"
criterion = "0.3"
criterion = { git = "git://github.com/pksunkara/criterion.rs", version = "0.3" }
[features]
default = ["suggestions", "color", "vec_map", "derive", "std", "cargo"]

View file

@ -1,3 +1,4 @@
#[cfg(feature = "suggestions")]
use std::cmp::Ordering;
// Third Party