Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:

- name: Build with nix and run checks
run: |
nix flake check --print-build-logs
nix flake check --max-jobs 2 --print-build-logs

check-win:
name: "check windows"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,39 +38,39 @@ jobs:
bin: rnk
name: rnk-x86_64-unknown-linux-musl-${{ needs.prepare-version.outputs.RNK_RELEASE_VERSION}}.tar.gz
cargo_command: cargo
features: "--no-default-features --features vendored-openssl"
features: "--no-default-features --features vendored-openssl,vendored-git"

- os_name: Linux-aarch64
os: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
bin: rnk
name: rnk-aarch64-unknown-linux-musl-${{ needs.prepare-version.outputs.RNK_RELEASE_VERSION}}.tar.gz
cargo_command: cargo
features: "--no-default-features --features vendored-openssl"
features: "--no-default-features --features vendored-openssl,vendored-git"

- os_name: Windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
bin: rnk.exe
name: rnk-x86_64-pc-windows-msvc-${{ needs.prepare-version.outputs.RNK_RELEASE_VERSION}}.zip
cargo_command: cargo
features: "--no-default-features --features vendored-openssl"
features: "--no-default-features --features vendored-openssl,vendored-git"

- os_name: macOS-x86_64
os: macOS-latest
target: x86_64-apple-darwin
bin: rnk
name: rnk-x86_64-apple-darwin-${{ needs.prepare-version.outputs.RNK_RELEASE_VERSION}}.tar.gz
cargo_command: cargo
features: "--no-default-features --features vendored-openssl"
features: "--no-default-features --features vendored-openssl,vendored-git"

- os_name: macOS-aarch64
os: macOS-latest
target: aarch64-apple-darwin
bin: rnk
name: rnk-aarch64-apple-darwin-${{ needs.prepare-version.outputs.RNK_RELEASE_VERSION}}.tar.gz
cargo_command: cargo
features: "--no-default-features --features vendored-openssl"
features: "--no-default-features --features vendored-openssl,vendored-git"

runs-on: ${{ matrix.platform.os }}
steps:
Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

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

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ build = "build.rs"
[dependencies]
clap = { version = "4.6.6", features = ["derive", "wrap_help"] }
clap_complete = { version = "4.6.9", features = ["unstable-dynamic"] }
console = { version = "0.16.4" }
env_logger = { version = "0.11.11" }
log = { version = "0.4.34" }
openssl = { version = "0.10.81", optional = true }
Expand All @@ -40,7 +39,6 @@ regex-macro = { version = "0.3.0" }
iso8601-timestamp = { version = "0.4" }
toml = { version = "1.1.5" }
git2 = { version = "0.21.0", default-features = false, features = [
"vendored-libgit2",
"https",
"ssh",
] }
Expand Down Expand Up @@ -95,6 +93,7 @@ vendored-openssl = [
"openssl/vendored",
"reqwest/native-tls-vendored",
] # include compiled openssl library
vendored-git = ["git2/vendored-libgit2"] # statically link vendored libgit2
vendored-zlib = [
"git2/zlib-ng-compat",
] # without this feature wherever the cli is installed needs to have zlib.so
Expand Down
117 changes: 62 additions & 55 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
pkgs.openssl
pkgs.installShellFiles
pkgs.git
pkgs.libgit2
pkgs.libssh2
]
++ lib.optionals pkgs.stdenv.isDarwin [
# Additional darwin specific inputs can be set here
Expand Down Expand Up @@ -100,6 +102,8 @@
inherit cargoArtifacts;
# additional arguments to cargo for building the app, --release is already there
cargoExtraArgs = "";
# we run nextest further down, no need to run tests while building
doCheck = false;
postInstall = ''
for shell in fish zsh bash; do
echo "COMPLETE=$shell rnk" > rnk.$shell
Expand All @@ -108,63 +112,66 @@
'';
});
in {
checks = {
# Build the crate as part of `nix flake check` for convenience
inherit my-crate;

# Run clippy (and deny all warnings) on the crate source,
# again, reusing the dependency artifacts from above.
#
# Note that this is done as a separate derivation so that
# we can block the CI if there are issues here, but not
# prevent downstream consumers from building our crate by itself.
my-crate-clippy = craneLib.cargoClippy (commonArgs
// {
inherit cargoArtifacts;
cargoClippyExtraArgs = "--features user-doc --all-targets -- --deny warnings";
});

my-crate-doc = craneLib.cargoDoc (commonArgs
// {
inherit cargoArtifacts;
});

my-user-docs = craneLib.mkCargoDerivation (commonArgs
// {
inherit cargoArtifacts;
pnameSuffix = "-userdocs";
buildPhaseCargoCommand = "cargoWithProfile run --features user-doc -- user-doc ${docSrc}";
});

# Check formatting
my-crate-fmt = craneLib.cargoFmt {
inherit src;
inherit version;
};

# Audit dependencies
my-crate-audit = craneLib.cargoAudit {
inherit src advisory-db;
cargoAuditExtraArgs = "--ignore RUSTSEC-2023-0071";
inherit version;
};
checks =
{
# Build the crate as part of `nix flake check` for convenience
inherit my-crate;

# Run clippy (and deny all warnings) on the crate source,
# again, reusing the dependency artifacts from above.
#
# Note that this is done as a separate derivation so that
# we can block the CI if there are issues here, but not
# prevent downstream consumers from building our crate by itself.
my-crate-clippy = craneLib.cargoClippy (commonArgs
// {
inherit cargoArtifacts;
cargoClippyExtraArgs = "--features user-doc --all-targets -- --deny warnings";
});

# Audit licenses
my-crate-deny = craneLib.cargoDeny {
inherit src;
inherit version;
};
my-crate-doc = craneLib.cargoDoc (commonArgs
// {
inherit cargoArtifacts;
});

# Run tests with cargo-nextest
# Consider setting `doCheck = false` on `my-crate` if you do not want
# the tests to run twice
my-crate-nextest = craneLib.cargoNextest (commonArgs
// {
inherit cargoArtifacts;
partitions = 1;
partitionType = "count";
});
};
# Check formatting
my-crate-fmt = craneLib.cargoFmt {
inherit src;
inherit version;
};

# Audit dependencies
my-crate-audit = craneLib.cargoAudit {
inherit src advisory-db;
cargoAuditExtraArgs = "--ignore RUSTSEC-2023-0071";
inherit version;
};

# Audit licenses
my-crate-deny = craneLib.cargoDeny {
inherit src;
inherit version;
};

# Run tests with cargo-nextest
# Consider setting `doCheck = false` on `my-crate` if you do not want
# the tests to run twice
my-crate-nextest = craneLib.cargoNextest (commonArgs
// {
inherit cargoArtifacts;
partitions = 1;
partitionType = "count";
});
}
// (lib.optionalAttrs pkgs.stdenv.isLinux {
# User docs build is slow on macOS (compiles git2 from C), only run on Linux
my-user-docs = craneLib.mkCargoDerivation (commonArgs
// {
inherit cargoArtifacts;
pnameSuffix = "-userdocs";
buildPhaseCargoCommand = "cargoWithProfile run --features user-doc -- user-doc ${docSrc}";
});
});

packages =
{
Expand Down
Loading