Skip to content

Commit

Permalink
Merge pull request #94 from privacy-scaling-explorations/purely-upstream
Browse files Browse the repository at this point in the history
Purely upstream
  • Loading branch information
ChihChengLiang authored Aug 19, 2022
2 parents ad425ed + 25b47f2 commit 2a19e44
Show file tree
Hide file tree
Showing 182 changed files with 41,833 additions and 6,685 deletions.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
timezone: Etc/UTC
open-pull-requests-limit: 10
reviewers:
- str4d
assignees:
- str4d
labels:
- "A-CI"
35 changes: 35 additions & 0 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Benchmarks
on:
push:
branches:
- main

permissions:
contents: write
deployments: write

jobs:
benchmark:
name: Performance regression check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.56.1
override: true
- name: Run benchmark
run: cargo bench -- --output-format bencher | tee output.txt
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: halo2 Benchmark
tool: 'cargo'
output-file-path: output.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Show alert with commit comment on detecting possible performance regression
alert-threshold: '200%'
comment-on-alert: true
fail-on-alert: true
alert-comment-cc-users: '@str4d'
49 changes: 49 additions & 0 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: halo2 book

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true

- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: 'latest'

- name: Install mdbook-katex
uses: actions-rs/cargo@v1
with:
command: install
args: mdbook-katex

- name: Build halo2 book
run: mdbook build book/

- name: Build latest rustdocs
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --workspace --all-features
env:
RUSTDOCFLAGS: -Z unstable-options --enable-index-page --cfg docsrs --html-in-header ${{ github.workspace }}/halo2_proofs/katex-header.html

- name: Move latest rustdocs into book
run: |
mkdir -p ./book/book/rustdoc
mv ./target/doc ./book/book/rustdoc/latest
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/book
58 changes: 40 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# We don't need to test across multiple platforms yet
# os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-latest]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
override: false
toolchain: 1.56.1
override: true
- name: Run tests
uses: actions-rs/cargo@v1
with:
Expand All @@ -33,10 +32,11 @@ jobs:
- wasm32-wasi

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
override: false
toolchain: 1.56.1
override: true
- name: Add target
run: rustup target add ${{ matrix.target }}
- name: cargo build
Expand All @@ -50,27 +50,49 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
override: false
toolchain: 1.56.1
override: true
# Build benchmarks to prevent bitrot
- name: Build benchmarks
uses: actions-rs/cargo@v1
with:
command: build
args: --benches --examples --all-features

book:
name: Book tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.56.1
override: true
- name: cargo build
uses: actions-rs/cargo@v1
with:
command: build
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: '0.4.5'
- name: Test halo2 book
run: mdbook test -L target/debug/deps book/

codecov:
name: Code coverage
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
# Use stable for this to ensure that cargo-tarpaulin can be built.
- uses: actions-rs/toolchain@v1
with:
override: false
toolchain: stable
override: true
- name: Install cargo-tarpaulin
uses: actions-rs/cargo@v1
with:
Expand All @@ -82,19 +104,18 @@ jobs:
command: tarpaulin
args: --all-features --timeout 600 --out Xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{secrets.CODECOV_TOKEN}}
uses: codecov/codecov-action@v3.1.0

doc-links:
name: Intra-doc links
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
override: false
toolchain: 1.56.1
override: true
- name: cargo fetch
uses: actions-rs/cargo@v1
with:
Expand All @@ -113,10 +134,11 @@ jobs:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
override: false
toolchain: 1.56.1
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/lints-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Beta lints

# These lints are only informative, so we only run them directly on branches
# and not trial-merges of PRs, to reduce noise.
on: push

jobs:
clippy-beta:
name: Clippy (beta)
timeout-minutes: 30
runs-on: ubuntu-latest
continue-on-error: true

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: beta
components: clippy
override: true
- name: Run Clippy (beta)
uses: actions-rs/clippy-check@v1
continue-on-error: true
with:
name: Clippy (beta)
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -W clippy::all
9 changes: 5 additions & 4 deletions .github/workflows/lints-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ on: pull_request

jobs:
clippy:
name: Clippy (1.51.0)
name: Clippy (1.56.1)
timeout-minutes: 30
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.56.1
components: clippy
override: false
override: true
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
name: Clippy (1.51.0)
name: Clippy (1.56.1)
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -D warnings
27 changes: 0 additions & 27 deletions .github/workflows/trigger_proverbench_dispatch.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
Cargo.lock
.vscode
**/*.html
.DS_Store
35 changes: 0 additions & 35 deletions COPYING

This file was deleted.

16 changes: 16 additions & 0 deletions COPYING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# License

Licensed under either of

* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)

at your option.

# Contribution

Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the Apache-2.0
license, shall be dual licensed as above, without any additional terms or
conditions.

Loading

0 comments on commit 2a19e44

Please sign in to comment.