Skip to content

Commit

Permalink
chore: nix stuff (#47)
Browse files Browse the repository at this point in the history
* .

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .

* .

fmt.toml
  • Loading branch information
Ethan-000 committed Jul 12, 2023
1 parent 3aee1c0 commit 6c76a1f
Show file tree
Hide file tree
Showing 55 changed files with 727 additions and 629 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Cargo.lock linguist-generated=true
flake.lock linguist-generated=true
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: "weekly"
24 changes: 24 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: nix

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true

jobs:
nix:
name: nix build
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v3

- name: setup nix
uses: cachix/install-nix-action@v22
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: run `nix flake check`
run: nix flake check --no-update-lock-file --show-trace
25 changes: 25 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Lint PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
fix
feat
chore
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ node_modules
pkg/
**/noir

# Nix stuff
**/outputs
result
.envrc.local
.direnv/

# Nargo output
*.proof
*.acir
Expand Down
5 changes: 5 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
comment_width = 100
imports_granularity = "Crate"
use_field_init_shorthand = true
use_small_heuristics = "Max"
wrap_comments = true
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

All notable changes to this project will be documented in this file.

## [0.1.2] - 2023-06-27

### Features

- Add wasm bindgen (#44)

### Miscellaneous Tasks

- Refactor codebase (#43)
- Deny & cleanup (#45)

<!-- generated by git-cliff -->
75 changes: 75 additions & 0 deletions cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# git-cliff ~ default configuration file
# https://git-cliff.org/docs/configuration
#
# Lines starting with "#" are comments.
# Configuration options are organized into tables and keys.
# See documentation for more information on available options.

[changelog]
# changelog header
header = """
# Changelog\n
All notable changes to this project will be documented in this file.\n
"""
# template for the changelog body
# https://tera.netlify.app/docs
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
{% endfor %}
{% endfor %}\n
"""
# remove the leading and trailing whitespace from the template
trim = true
# changelog footer
footer = """
<!-- generated by git-cliff -->
"""

[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = true
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
commit_preprocessors = [
# { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))"}, # replace issue numbers
]
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^feat", group = "Features" },
{ message = "^fix", group = "Bug Fixes" },
{ message = "^doc", group = "Documentation" },
{ message = "^perf", group = "Performance" },
{ message = "^refactor", group = "Refactor" },
{ message = "^style", group = "Styling" },
{ message = "^test", group = "Testing" },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore", group = "Miscellaneous Tasks" },
{ body = ".*security", group = "Security" },
]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# glob pattern for matching git tags
tag_pattern = "v[0-9]*"
# regex for skipping tags
skip_tags = "v0.1.0-beta.1"
# regex for ignoring tags
ignore_tags = ""
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"
# limit the number of commits included in the changelog.
# limit_commits = 42
32 changes: 8 additions & 24 deletions crates/noir_halo2_backend_axiom/benches/bench_compilation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,51 +8,35 @@ fn benchmark_tests_compilation(c: &mut Criterion) {

// 1_mul
let path = test_program_dir_path("1_mul");
c.bench_function("1_mul_compilation", |b| {
b.iter(|| run_nargo_compile(path.clone()))
});
c.bench_function("1_mul_compilation", |b| b.iter(|| run_nargo_compile(path.clone())));

// 2_div
let path = test_program_dir_path("2_div");
c.bench_function("2_div_compilation", |b| {
b.iter(|| run_nargo_compile(path.clone()))
});
c.bench_function("2_div_compilation", |b| b.iter(|| run_nargo_compile(path.clone())));

// 3_add
let path = test_program_dir_path("3_add");
c.bench_function("3_add_compilation", |b| {
b.iter(|| run_nargo_compile(path.clone()))
});
c.bench_function("3_add_compilation", |b| b.iter(|| run_nargo_compile(path.clone())));

// 4_sub
let path = test_program_dir_path("4_sub");
c.bench_function("4_sub_compilation", |b| {
b.iter(|| run_nargo_compile(path.clone()))
});
c.bench_function("4_sub_compilation", |b| b.iter(|| run_nargo_compile(path.clone())));

// 5_over
let path = test_program_dir_path("5_over");
c.bench_function("5_over_compilation", |b| {
b.iter(|| run_nargo_compile(path.clone()))
});
c.bench_function("5_over_compilation", |b| b.iter(|| run_nargo_compile(path.clone())));

// 6_array
let path = test_program_dir_path("6_array");
c.bench_function("6_array_compilation", |b| {
b.iter(|| run_nargo_compile(path.clone()))
});
c.bench_function("6_array_compilation", |b| b.iter(|| run_nargo_compile(path.clone())));

// 7_function
let path = test_program_dir_path("7_function");
c.bench_function("7_function_compilation", |b| {
b.iter(|| run_nargo_compile(path.clone()))
});
c.bench_function("7_function_compilation", |b| b.iter(|| run_nargo_compile(path.clone())));

// bit_and
let path = test_program_dir_path("8_bit_and");
c.bench_function("8_bit_and_compilation", |b| {
b.iter(|| run_nargo_compile(path.clone()))
});
c.bench_function("8_bit_and_compilation", |b| b.iter(|| run_nargo_compile(path.clone())));
}

criterion_group! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,51 +8,35 @@ fn benchmark_tests_prove(c: &mut Criterion) {

// 1_mul
let path = test_program_dir_path("1_mul");
c.bench_function("1_mul_axiom_prove", |b| {
b.iter(|| run_nargo_prove(path.clone()))
});
c.bench_function("1_mul_axiom_prove", |b| b.iter(|| run_nargo_prove(path.clone())));

// 2_div
let path = test_program_dir_path("2_div");
c.bench_function("2_div_axiom_prove", |b| {
b.iter(|| run_nargo_prove(path.clone()))
});
c.bench_function("2_div_axiom_prove", |b| b.iter(|| run_nargo_prove(path.clone())));

// 3_add
let path = test_program_dir_path("3_add");
c.bench_function("3_add_axiom_prove", |b| {
b.iter(|| run_nargo_prove(path.clone()))
});
c.bench_function("3_add_axiom_prove", |b| b.iter(|| run_nargo_prove(path.clone())));

// 4_sub
let path = test_program_dir_path("4_sub");
c.bench_function("4_sub_axiom_prove", |b| {
b.iter(|| run_nargo_prove(path.clone()))
});
c.bench_function("4_sub_axiom_prove", |b| b.iter(|| run_nargo_prove(path.clone())));

// 5_over
let path = test_program_dir_path("5_over");
c.bench_function("5_over_axiom_prove", |b| {
b.iter(|| run_nargo_prove(path.clone()))
});
c.bench_function("5_over_axiom_prove", |b| b.iter(|| run_nargo_prove(path.clone())));

// 6_array
let path = test_program_dir_path("6_array");
c.bench_function("6_array_axiom_prove", |b| {
b.iter(|| run_nargo_prove(path.clone()))
});
c.bench_function("6_array_axiom_prove", |b| b.iter(|| run_nargo_prove(path.clone())));

// 7_function
let path = test_program_dir_path("7_function");
c.bench_function("7_function_axiom_prove", |b| {
b.iter(|| run_nargo_prove(path.clone()))
});
c.bench_function("7_function_axiom_prove", |b| b.iter(|| run_nargo_prove(path.clone())));

// bit_and
let path = test_program_dir_path("8_bit_and");
c.bench_function("8_bit_and_axiom_prove", |b| {
b.iter(|| run_nargo_prove(path.clone()))
});
c.bench_function("8_bit_and_axiom_prove", |b| b.iter(|| run_nargo_prove(path.clone())));
}

criterion_group! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,51 +8,35 @@ fn benchmark_tests_verify(c: &mut Criterion) {

// 1_mul
let path = test_program_dir_path("1_mul");
c.bench_function("1_mul_axiom_verify", |b| {
b.iter(|| run_nargo_verify(path.clone()))
});
c.bench_function("1_mul_axiom_verify", |b| b.iter(|| run_nargo_verify(path.clone())));

// 2_div
let path = test_program_dir_path("2_div");
c.bench_function("2_div_axiom_verify", |b| {
b.iter(|| run_nargo_verify(path.clone()))
});
c.bench_function("2_div_axiom_verify", |b| b.iter(|| run_nargo_verify(path.clone())));

// 3_add
let path = test_program_dir_path("3_add");
c.bench_function("3_add_axiom_verify", |b| {
b.iter(|| run_nargo_verify(path.clone()))
});
c.bench_function("3_add_axiom_verify", |b| b.iter(|| run_nargo_verify(path.clone())));

// 4_sub
let path = test_program_dir_path("4_sub");
c.bench_function("4_sub_axiom_verify", |b| {
b.iter(|| run_nargo_verify(path.clone()))
});
c.bench_function("4_sub_axiom_verify", |b| b.iter(|| run_nargo_verify(path.clone())));

// 5_over
let path = test_program_dir_path("5_over");
c.bench_function("5_over_axiom_verify", |b| {
b.iter(|| run_nargo_verify(path.clone()))
});
c.bench_function("5_over_axiom_verify", |b| b.iter(|| run_nargo_verify(path.clone())));

// 6_array
let path = test_program_dir_path("6_array");
c.bench_function("6_array_axiom_verify", |b| {
b.iter(|| run_nargo_verify(path.clone()))
});
c.bench_function("6_array_axiom_verify", |b| b.iter(|| run_nargo_verify(path.clone())));

// 7_function
let path = test_program_dir_path("7_function");
c.bench_function("7_function_axiom_verify", |b| {
b.iter(|| run_nargo_verify(path.clone()))
});
c.bench_function("7_function_axiom_verify", |b| b.iter(|| run_nargo_verify(path.clone())));

// bit_and
let path = test_program_dir_path("8_bit_and");
c.bench_function("8_bit_and_axiom_verify", |b| {
b.iter(|| run_nargo_verify(path.clone()))
});
c.bench_function("8_bit_and_axiom_verify", |b| b.iter(|| run_nargo_verify(path.clone())));
}

criterion_group! {
Expand Down
Loading

0 comments on commit 6c76a1f

Please sign in to comment.