Skip to content

Commit

Permalink
chore(ci): check dependencies licenses with cargo-deny
Browse files Browse the repository at this point in the history
  • Loading branch information
soonum committed Oct 17, 2024
1 parent 1a5dfb3 commit b5b46f5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ install_tarpaulin: install_rs_build_toolchain
cargo $(CARGO_RS_BUILD_TOOLCHAIN) install cargo-tarpaulin --locked || \
( echo "Unable to install cargo tarpaulin, unknown error." && exit 1 )

.PHONY: install_cargo_deny # Install cargo-deny to check licenses
install_cargo_deny: install_rs_build_toolchain
@cargo deny --version > /dev/null 2>&1 || \
cargo $(CARGO_RS_BUILD_TOOLCHAIN) install cargo-deny || \
( echo "Unable to install cargo deny, unknown error." && exit 1 )

.PHONY: install_tfhe_lints # Install custom tfhe-rs lints
install_tfhe_lints:
(cd utils/cargo-tfhe-lints-inner && cargo install --path .) && \
Expand Down Expand Up @@ -296,6 +302,10 @@ check_newline: check_linelint_installed
lint_workflow: check_actionlint_installed
actionlint

.PHONY: check_licenses # Run cargo-deny to check dependencies licenses
check_licenses: install_cargo_deny
cargo deny check licenses

.PHONY: clippy_core # Run clippy lints on core_crypto with and without experimental features
clippy_core: install_rs_check_toolchain
RUSTFLAGS="$(RUSTFLAGS)" cargo "$(CARGO_RS_CHECK_TOOLCHAIN)" clippy \
Expand Down Expand Up @@ -1251,14 +1261,14 @@ sha256_bool: install_rs_check_toolchain
--features=$(TARGET_ARCH_FEATURE),boolean

.PHONY: pcc # pcc stands for pre commit checks (except GPU)
pcc: no_tfhe_typo no_dbg_log check_fmt check_typos lint_doc check_md_docs_are_tested check_intra_md_links \
pcc: no_tfhe_typo no_dbg_log check_fmt check_typos check_licenses lint_doc check_md_docs_are_tested check_intra_md_links \
clippy_all tfhe_lints check_compile_tests

.PHONY: pcc_gpu # pcc stands for pre commit checks for GPU compilation
pcc_gpu: clippy_gpu clippy_cuda_backend check_compile_tests_benches_gpu check_rust_bindings_did_not_change

.PHONY: fpcc # pcc stands for pre commit checks, the f stands for fast
fpcc: no_tfhe_typo no_dbg_log check_fmt check_typos lint_doc check_md_docs_are_tested clippy_fast \
fpcc: no_tfhe_typo no_dbg_log check_fmt check_typos check_licenses lint_doc check_md_docs_are_tested clippy_fast \
check_compile_tests

.PHONY: conformance # Automatically fix problems that can be fixed
Expand Down
1 change: 1 addition & 0 deletions apps/trivium/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "tfhe-trivium"
version = "0.1.0"
edition = "2021"
license = "BSD-3-Clause-Clear"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
15 changes: 15 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This section is considered when running `cargo deny check licenses`
# More documentation for the licenses section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
[licenses]
# List of explicitly allowed licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
allow = [
"MIT",
"BSD-3-Clause-Clear",
"BSD-3-Clause",
"ISC",
"Apache-2.0",
"Unicode-DFS-2016"
]
1 change: 1 addition & 0 deletions tasks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "tasks"
version = "0.0.0"
edition = "2021"
license = "BSD-3-Clause-Clear"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down

0 comments on commit b5b46f5

Please sign in to comment.