Skip to content

Commit aa11b8d

Browse files
Merge pull request #120 from blockfrost/chore/ci-cargo-checks
chore: run Cargo checks on the Hydra CI
2 parents 0baa31c + 32a9c62 commit aa11b8d

File tree

7 files changed

+90
-8
lines changed

7 files changed

+90
-8
lines changed

.cargo/audit.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[advisories]
2+
ignore = [
3+
"RUSTSEC-2022-0004", # Solution: No fixed upgrade is available!
4+
"RUSTSEC-2024-0421", # FIXME: upgrade to idna >=1.0.0 (transitive dependency of `url`)
5+
]
6+
informational_warnings = ["unmaintained"]
7+
severity_threshold = "low"
8+
9+
[output]
10+
deny = ["unmaintained"]
11+
format = "terminal"
12+
quiet = false
13+
show_tree = true
14+
15+
[yanked]
16+
enabled = true
17+
update_index = true

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[package]
22
name = "blockfrost-platform"
33
version = "0.0.1"
4+
license = "Apache-2.0"
45
edition = "2021"
56
build = "build.rs"
67

deny.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[licenses]
2+
# See <https://spdx.org/licenses/> for list of possible licenses
3+
allow = [
4+
"Apache-2.0",
5+
"BSD-3-Clause",
6+
"CC0-1.0",
7+
"MIT",
8+
"Unicode-3.0",
9+
"MPL-2.0",
10+
"BlueOak-1.0.0",
11+
"Zlib",
12+
]
13+
confidence-threshold = 0.8

flake.lock

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
devshell.inputs.nixpkgs.follows = "nixpkgs";
1616
cardano-playground.url = "github:input-output-hk/cardano-playground/b4f47fd78beec0ea1ed880d6f0b794919e0c0463";
1717
cardano-playground.flake = false; # otherwise, +9k dependencies in flake.lock…
18+
advisory-db.url = "github:rustsec/advisory-db";
19+
advisory-db.flake = false;
1820
};
1921

2022
outputs = inputs: let
@@ -45,10 +47,10 @@
4547
system,
4648
pkgs,
4749
...
48-
}: {
49-
packages = let
50-
internal = inputs.self.internal.${system};
51-
in
50+
}: let
51+
internal = inputs.self.internal.${system};
52+
in {
53+
packages =
5254
{
5355
default = internal.package;
5456
inherit (internal) tx-build cardano-address testgen-hs;
@@ -59,6 +61,8 @@
5961

6062
devshells.default = import ./nix/devshells.nix {inherit inputs;};
6163

64+
checks = internal.cargoChecks;
65+
6266
treefmt = {pkgs, ...}: {
6367
projectRootFile = "flake.nix";
6468
programs.alejandra.enable = true; # Nix

nix/internal/unix.nix

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ in rec {
3838
package = craneLib.buildPackage (commonArgs
3939
// {
4040
inherit cargoArtifacts;
41+
doCheck = false; # we run tests with `cargo-nextest` below
4142
postInstall = ''
4243
chmod -R +w $out
4344
mv $out/bin $out/libexec
@@ -47,6 +48,35 @@ in rec {
4748
'';
4849
});
4950

51+
cargoChecks = {
52+
cargo-clippy = craneLib.cargoClippy (commonArgs
53+
// {
54+
inherit cargoArtifacts;
55+
# Maybe also add `--deny clippy::pedantic`?
56+
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
57+
});
58+
59+
cargo-doc = craneLib.cargoDoc (commonArgs
60+
// {
61+
RUSTDOCFLAGS = "-D warnings";
62+
inherit cargoArtifacts;
63+
});
64+
65+
cargo-audit = craneLib.cargoAudit {
66+
inherit src;
67+
inherit (inputs) advisory-db;
68+
};
69+
70+
cargo-deny = craneLib.cargoDeny {
71+
inherit src;
72+
};
73+
74+
cargo-test = craneLib.cargoNextest (commonArgs
75+
// {
76+
inherit cargoArtifacts;
77+
});
78+
};
79+
5080
cardano-node-flake = let
5181
unpatched = inputs.cardano-node;
5282
in

0 commit comments

Comments
 (0)