diff --git a/.github/workflows/rust-ci.yaml b/.github/workflows/rust-ci.yaml new file mode 100644 index 0000000..f6a0b5f --- /dev/null +++ b/.github/workflows/rust-ci.yaml @@ -0,0 +1,26 @@ +name: Rust CI +on: + pull_request: + workflow_dispatch: + push: + branches: + - main + - prod + tags: + - '**' + +jobs: + cargo-deny: + name: Licensing and Advisories + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4.2.1 + - uses: EmbarkStudios/cargo-deny-action@8371184bd11e21dcf8ac82ebf8c9c9f74ebf7268 # pin@v2.0.1 + + fmt: + name: Formatting + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4.2.1 + - name: Run cargo format + run: cargo fmt --all --check diff --git a/Cargo.toml b/Cargo.toml index 87a3759..87e63a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,9 @@ [package] name = "hyrax" -version = "0.1.0" +version = "0.0.0" +repository = "https://github.com/worldcoin/remainder-hyrax-tfh" edition = "2021" +publish = false [dependencies] itertools = "0.11.0" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..43155f4 --- /dev/null +++ b/LICENSE @@ -0,0 +1 @@ +TODO: Add a FOSS license diff --git a/deny.toml b/deny.toml new file mode 100644 index 0000000..93caaa4 --- /dev/null +++ b/deny.toml @@ -0,0 +1,53 @@ +[graph] +# Cargo deny will check dependencies via `--all-features` +all-features = true + +[advisories] +version = 2 +ignore = [ +] + +[sources] +unknown-registry = "deny" + +[licenses] +version = 2 +# We want really high confidence when inferring licenses from text +confidence-threshold = 1.0 + +# List of explicitly allowed licenses +# See https://spdx.org/licenses/ for list of possible licenses +allow = [ + "0BSD", + "Apache-2.0 WITH LLVM-exception", + "Apache-2.0", + "BSD-2-Clause", + "BSD-2-Clause-Patent", + "BSD-3-Clause", + "BSL-1.0", + "CC0-1.0", + "ISC", + "LicenseRef-ring", + "LicenseRef-wc-proprietary", + "MIT", + "MPL-2.0", # Although this is copyleft, it is scoped to modifying the original files + "OpenSSL", + "Unicode-DFS-2016", + "Unlicense", + "Zlib", +] + +# See https://github.com/briansmith/ring/blob/95948b3977013aed16db92ae32e6b8384496a740/deny.toml#L12 +[[licenses.clarify]] +name = "ring" +expression = "LicenseRef-ring" +license-files = [ + { path = "LICENSE", hash = 0xbd0eed23 }, +] + +[[licenses.clarify]] +name = "hyrax" +expression = "LicenseRef-wc-proprietary" +license-files = [ + { path = "LICENSE", hash = 0xeafa4d94 } +] diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..f075664 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,5 @@ +[toolchain] +channel = "1.81.0" # See Cargo.toml +targets = ["aarch64-unknown-linux-gnu", "x86_64-unknown-linux-gnu"] +profile = "minimal" +components = ["clippy", "llvm-tools-preview", "rustfmt", "rust-src", "rust-analyzer"] diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..d1a7fbe --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +# Use default cargo settings