Skip to content

Commit c29666b

Browse files
committed
fix workflow
1 parent c2aeae3 commit c29666b

File tree

3 files changed

+32
-146
lines changed

3 files changed

+32
-146
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ jobs:
1111
- uses: cachix/install-nix-action@v31
1212
with:
1313
github_access_token: ${{ secrets.GITHUB_TOKEN }}
14-
- run: nix build --print-build-logs --no-link
14+
- run: nix run .#check
15+
- run: nix run .#test

flake.lock

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

flake.nix

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,43 @@
44
inputs = {
55
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
66
flake-utils.url = "github:numtide/flake-utils";
7-
poetry2nix = {
8-
url = "github:nix-community/poetry2nix";
9-
inputs.nixpkgs.follows = "nixpkgs";
10-
};
117
};
128

13-
outputs = { self, nixpkgs, flake-utils, poetry2nix }: flake-utils.lib.eachDefaultSystem (system:
9+
outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system:
1410
let
1511
pkgs = import nixpkgs {
1612
inherit system;
1713
};
14+
uv = pkgs.uv;
15+
in
16+
{
17+
packages = rec {
18+
check = pkgs.writeShellScriptBin "check" ''
19+
${uv}/bin/uv run ruff format --check
20+
${uv}/bin/uv run ruff check
21+
'';
1822

19-
p2nix = poetry2nix.lib.mkPoetry2Nix {
20-
inherit pkgs;
21-
};
23+
test = pkgs.writeShellScriptBin "test" ''
24+
${uv}/bin/uv run pytest
25+
'';
2226

23-
gingerino = p2nix.mkPoetryApplication {
24-
projectDir = self;
25-
python = pkgs.python313;
26-
preferWheels = true;
27-
checkPhase = ''
28-
runHook preCheck
27+
build = pkgs.writeShellScriptBin "build" ''
28+
${check}/bin/check
29+
${test}/bin/test
2930
30-
ruff check .
31-
ruff format --check .
32-
pytest
31+
rm -rf dist
32+
${uv}/bin/uv build "$@"
33+
'';
34+
35+
publish = pkgs.writeShellScriptBin "publish" ''
36+
${build}/bin/build
3337
34-
runHook postCheck
38+
${uv}/bin/uv publish
3539
'';
3640
};
37-
in
38-
{
39-
packages = {
40-
default = gingerino;
41-
};
4241
devShells = {
4342
default = pkgs.mkShellNoCC {
44-
buildInputs = gingerino.buildInputs;
43+
buildInputs = [ uv ];
4544
};
4645
};
4746
}

0 commit comments

Comments
 (0)