Skip to content

Commit

Permalink
create cargo workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
marijanp committed Jan 9, 2024
1 parent 0812902 commit 7d93354
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: nix flake check -L --show-trace

- name: kairos-node
run: nix build -L --no-link --show-trace .#packages.x86_64-linux.kairos-node
run: nix build -L --no-link --show-trace .#packages.x86_64-linux.kairos

- name: kairos-prover
run: nix build -L --no-link --show-trace .#packages.x86_64-linux.kairos-prover
2 changes: 1 addition & 1 deletion kairos-node/Cargo.lock → Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[workspace]
resolver = "2"

members = [
"kairos-cli",
]

[workspace.package]
name = "kairos"
version = "0.1.0"
edition = "2021"
20 changes: 10 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

kairosNodeAttrs = {
src = lib.cleanSourceWith {
src = craneLib.path ./kairos-node;
src = craneLib.path ./.;
filter = path: type: craneLib.filterCargoSources path type;
};
nativeBuildInputs = with pkgs; [ pkg-config openssl.dev ];
Expand All @@ -58,29 +58,29 @@
};

packages = {
kairos-node-deps = craneLib.buildDepsOnly (kairosNodeAttrs // {
pname = "kairos-node";
kairos-deps = craneLib.buildDepsOnly (kairosNodeAttrs // {
pname = "kairos";
});

kairos-node = craneLib.buildPackage (kairosNodeAttrs // {
cargoArtifacts = self'.packages.kairos-node-deps;
kairos = craneLib.buildPackage (kairosNodeAttrs // {
cargoArtifacts = self'.packages.kairos-deps;
});

default = self'.packages.kairos-node;
default = self'.packages.kairos;

kairos-node-docs = craneLib.cargoDoc (kairosNodeAttrs // {
cargoArtifacts = self'.packages.kairos-node-deps;
kairos-docs = craneLib.cargoDoc (kairosNodeAttrs // {
cargoArtifacts = self'.packages.kairos-deps;
});
};

checks = {
lint = craneLib.cargoClippy (kairosNodeAttrs // {
cargoArtifacts = self'.packages.kairos-node-deps;
cargoArtifacts = self'.packages.kairos-deps;
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
});

coverage-report = craneLib.cargoTarpaulin (kairosNodeAttrs // {
cargoArtifacts = self'.packages.kairos-node-deps;
cargoArtifacts = self'.packages.kairos-deps;
});

audit = craneLib.cargoAudit {
Expand Down
9 changes: 8 additions & 1 deletion kairos-node/Cargo.toml → kairos-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
[[bin]]
name = "kairos-cli"
path = "bin/main.rs"
version = "0.1.0"
test = false
bench = false

[package]
name = "kairos-node"
name = "kairos-cli"
version = "0.1.0"
edition = "2021"

Expand Down
File renamed without changes.

0 comments on commit 7d93354

Please sign in to comment.