Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Nix CI #939

Merged
merged 1 commit into from
Nov 6, 2024
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
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,24 @@ jobs:
with:
name: git-cliff.${{ github.run_id }}-profiler-report
path: git-cliff.**.flamegraph.svg

nix-flake:
name: Build Nix flake
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Install Nix
uses: nixbuild/nix-quick-install-action@v27

- name: Restore and cache Nix store
uses: nix-community/cache-nix-action@v5
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
gc-max-store-size-linux: 1073741824
purge: false

- name: Check Nix flake
run: nix flake check --all-systems -Lv --show-trace
28 changes: 27 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,31 @@
inherit system;
overlays = [ inputs.rust-overlay.overlays.rust-overlay ];
};
in {
base-git-cliff = { buildType }: pkgs.rustPlatform.buildRustPackage {
name = "git-cliff";
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
};
checkType = "debug";
inherit buildType;
checkFlags = [
"--skip=command"
"--skip=repo"
];
meta = with pkgs.lib; {
description = "A highly customizable Changelog Generator that follows Conventional Commit specifications";
homepage = "https://git-cliff.org/";
license = [ licenses.mit licenses.asl20 ];
};
};
in rec {
packages = rec {
git-cliff = base-git-cliff { buildType = "release"; };
git-cliff-debug = base-git-cliff { buildType = "debug"; };
default = git-cliff;
};

devShell = pkgs.mkShell {
CARGO_INSTALL_ROOT = "${toString ./.}/.cargo";

Expand All @@ -32,5 +56,7 @@
})
];
};

checks.check = packages.git-cliff-debug;
});
}
Loading