Skip to content

Commit

Permalink
ci: check formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pnmadelaine committed Sep 21, 2023
1 parent 86c6f33 commit 2f75f17
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ jobs:
run: nix build -L .#typhon-webapp
- name: Run API tests
run: nix build -L .#checks.x86_64-linux.api
- name: Check formatting
run: nix build -L .#checks.x86_64-linux.formatted
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
api = pkgs.callPackage ./nix/check-api.nix {
inherit typhon typhon-api-client-test;
};
formatted = pkgs.callPackage ./nix/check-formatted.nix {inherit rustToolchain;};
nixos = pkgs.callPackage ./nix/nixos/test.nix {typhon = self;};
};

Expand Down
18 changes: 18 additions & 0 deletions nix/check-formatted.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
alejandra,
rustToolchain,
stdenv,
}:
stdenv.mkDerivation {
name = "formatted";
src = ../.;
nativeBuildInputs = [
alejandra
rustToolchain
];
buildPhase = ''
alejandra -c .
cargo fmt --check
'';
installPhase = "touch $out";
}

0 comments on commit 2f75f17

Please sign in to comment.