Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
feat: workflows (#9)
Browse files Browse the repository at this point in the history
* feat: add workflows

* allow dead code
  • Loading branch information
ratankaliani authored Oct 11, 2024
1 parent 2c4782f commit 96bce20
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: PR

on:
push:
branches: [main]
pull_request:
branches:
- "**"
merge_group:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Formatting & Clippy
runs-on: [runs-on, runner=4cpu-linux-arm64 , "run-id=${{ github.run_id }}"]
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt

- name: Run rustfmt
run: cargo fmt --all -- --check
env:
CARGO_INCREMENTAL: 1

- name: Run cargo clippy
run: cargo clippy --all-features --all-targets -- -D warnings -A incomplete-features
env:
CARGO_INCREMENTAL: 1
22 changes: 22 additions & 0 deletions .github/workflows/pr_lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: PR Lint

on:
pull_request_target:
types:
- opened
- edited

permissions:
pull-requests: read

jobs:
main:
name: Title
runs-on:
- runs-on
- runner=2cpu-linux-arm64
- run-id=${{ github.run_id }}
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions verifier/src/converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub(crate) fn deserialize_with_flags(buf: &[u8]) -> Result<(Fq, CompressedPointF
}
}

#[allow(dead_code)]
pub(crate) fn compressed_x_to_g1_point(buf: &[u8]) -> Result<AffineG1, Error> {
let (x, m_data) = deserialize_with_flags(buf)?;
let (y, neg_y) = AffineG1::get_ys_from_x_unchecked(x).ok_or(Error::InvalidPoint)?;
Expand Down Expand Up @@ -86,6 +87,7 @@ pub(crate) fn uncompressed_bytes_to_g1_point(buf: &[u8]) -> Result<AffineG1, Err
AffineG1::new(x, y).map_err(Error::Group)
}

#[allow(dead_code)]
pub(crate) fn compressed_x_to_g2_point(buf: &[u8]) -> Result<AffineG2, Error> {
if buf.len() != 64 {
return Err(Error::InvalidXLength);
Expand Down

0 comments on commit 96bce20

Please sign in to comment.