File tree Expand file tree Collapse file tree 6 files changed +73
-28
lines changed
Expand file tree Collapse file tree 6 files changed +73
-28
lines changed Original file line number Diff line number Diff line change 1+ name : Nix Checks
2+ on :
3+ pull_request :
4+ push :
5+ branches :
6+ - main
7+
8+ jobs :
9+ check :
10+ name : Check
11+ runs-on : ubuntu-latest
12+ timeout-minutes : 10
13+ steps :
14+ - uses : actions/checkout@v4
15+ - uses : cachix/install-nix-action@v30
16+ - run : nix flake check
Original file line number Diff line number Diff line change 11{
22 inputs . pkgs . url = "github:NixOS/nixpkgs/nixpkgs-unstable" ;
33 inputs . flake-utils . url = "github:numtide/flake-utils" ;
4+ inputs . treefmt-nix . url = "github:numtide/treefmt-nix" ;
5+ inputs . treefmt-nix . inputs . nixpkgs . follows = "pkgs" ;
46 outputs =
5- { pkgs , flake-utils , ... } :
7+ {
8+ self ,
9+ pkgs ,
10+ flake-utils ,
11+ treefmt-nix ,
12+ } :
613 let
714 prisma-factory = import ./prisma.nix ;
815 in
916 flake-utils . lib . eachDefaultSystem (
1017 system :
1118 let
1219 nixpkgs = import pkgs { inherit system ; } ;
20+ treefmt = treefmt-nix . lib . evalModule nixpkgs {
21+ # nixfmt is nixfmt-rfc-style
22+ programs . nixfmt . enable = true ;
23+ } ;
1324 in
1425 {
15- packages = import ./tests.nix { inherit prisma-factory nixpkgs ; } ;
26+ formatter = treefmt . config . build . wrapper ;
27+ checks =
28+ ( nixpkgs . callPackages ./tests.nix {
29+ inherit prisma-factory nixpkgs ; # nixpkgs can be removed once it is renamed to pkgs
30+ } )
31+ // {
32+ format = treefmt . config . build . check self ;
33+ } ;
1634 devShells . default =
1735 let
1836 prisma = (
Original file line number Diff line number Diff line change @@ -180,9 +180,7 @@ rec {
180180 "5" =
181181 pnpmLock :
182182 let
183- version = builtins . elemAt ( builtins . split ":" (
184- builtins . elemAt ( builtins . split ( "@prisma/engines-version/" ) pnpmLock ) 2
185- ) ) 0 ;
183+ version = builtins . elemAt ( builtins . split ":" ( builtins . elemAt ( builtins . split ( "@prisma/engines-version/" ) pnpmLock ) 2 ) ) 0 ;
186184 in
187185 nixpkgs . lib . lists . last ( nixpkgs . lib . strings . splitString "." version ) ;
188186
@@ -191,9 +189,7 @@ rec {
191189 "6" =
192190 pnpmLock :
193191 let
194- version = builtins . elemAt ( builtins . split ":" (
195- builtins . elemAt ( builtins . split ( "@prisma/engines-version@" ) pnpmLock ) 2
196- ) ) 0 ;
192+ version = builtins . elemAt ( builtins . split ":" ( builtins . elemAt ( builtins . split ( "@prisma/engines-version@" ) pnpmLock ) 2 ) ) 0 ;
197193 in
198194 nixpkgs . lib . lists . last ( nixpkgs . lib . strings . splitString "." version ) ;
199195
@@ -202,9 +198,7 @@ rec {
202198 "9" =
203199 pnpmLock :
204200 let
205- version = builtins . elemAt ( builtins . split "'" (
206- builtins . elemAt ( builtins . split ( "@prisma/engines-version@" ) pnpmLock ) 2
207- ) ) 0 ;
201+ version = builtins . elemAt ( builtins . split "'" ( builtins . elemAt ( builtins . split ( "@prisma/engines-version@" ) pnpmLock ) 2 ) ) 0 ;
208202 in
209203 nixpkgs . lib . lists . last ( nixpkgs . lib . strings . splitString "." version ) ;
210204 } ;
Original file line number Diff line number Diff line change @@ -116,9 +116,19 @@ With nix-prisma-utils it's the other way around. You can simply install prisma t
116116}
117117```
118118
119- ## Testing
119+ ## Contributing
120120
121- ` nix run .#test-all `
121+ Before contributing, please make sure that your code is formatted correctly by running
122+
123+ ``` sh
124+ nix fmt
125+ ```
126+
127+ All tests (including format check) can be run by
128+
129+ ``` sh
130+ nix flake check
131+ ```
122132
123133## License
124134
Original file line number Diff line number Diff line change 7070 bunx prisma generate
7171 '' ;
7272 } ;
73- test-all = writeShellApplication {
74- name = "test" ;
75- runtimeInputs = [
76- test-npm
77- test-pnpm
78- test-bun
79- ] ;
80- text = ''
81- test-npm
82- test-pnpm
83- test-bun
84- '' ;
85- } ;
8673in
8774{
8875 inherit
8976 test-npm
9077 test-pnpm
9178 test-bun
92- test-all
9379 ;
9480}
You can’t perform that action at this time.
0 commit comments