From 32fef3fcfaefdf8f252f1dd1232ccd9f50094323 Mon Sep 17 00:00:00 2001 From: arnau <17317030+arnaucube@users.noreply.github.com> Date: Tue, 29 Sep 2020 20:08:54 +0200 Subject: [PATCH] Add GHA --- .github/workflows/rust.yml | 13 +++++++++++++ .travis.yml | 9 --------- README.md | 2 +- benches/bench_mimc_hash.rs | 2 +- 4 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/rust.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..9635bb9 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,13 @@ +name: Test +on: [push, pull_request] +env: + CARGO_TERM_COLOR: always +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9f108b7..0000000 --- a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: rust -rust: -- stable - -cache: -- cargo - -script: -- RUST_BACKTRACE=1 cargo test --all diff --git a/README.md b/README.md index 20a92ba..411aa42 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# mimc-rs [![Crates.io](https://img.shields.io/crates/v/mimc-rs.svg)](https://crates.io/crates/mimc-rs) [![Build Status](https://travis-ci.org/arnaucube/mimc-rs.svg?branch=master)](https://travis-ci.org/arnaucube/mimc-rs) +# mimc-rs [![Crates.io](https://img.shields.io/crates/v/mimc-rs.svg)](https://crates.io/crates/mimc-rs) [![Test](https://github.com/arnaucube/mimc-rs/workflows/Test/badge.svg)](https://github.com/arnaucube/mimc-rs/actions?query=workflow%3ATest) MIMC7 hash implementation in Rust, a zkSNARK friendly hash function. https://eprint.iacr.org/2016/492.pdf diff --git a/benches/bench_mimc_hash.rs b/benches/bench_mimc_hash.rs index efcdcc7..cb1188f 100644 --- a/benches/bench_mimc_hash.rs +++ b/benches/bench_mimc_hash.rs @@ -20,7 +20,7 @@ fn criterion_benchmark(c: &mut Criterion) { big_arr.push(b2.clone()); let mimc7 = Mimc7::new(); - c.bench_function("hash", |b| b.iter(|| mimc7.hash(big_arr.clone()).unwrap())); + c.bench_function("hash", |b| b.iter(|| mimc7.hash(big_arr.clone()))); } criterion_group!(benches, criterion_benchmark);