git.fiddlerwoaroof.com
Browse code

fix: use nix to run test

Edward Langley authored on 06/10/2023 08:40:01
Showing 3 changed files
... ...
@@ -44,7 +44,7 @@ jobs:
44 44
 
45 45
       - name: Run test
46 46
         run: |
47
-          ./test.zsh
47
+          nix run .\#do-test
48 48
       - uses: actions/upload-artifact@v3
49 49
         with:
50 50
           name: executables
... ...
@@ -36,6 +36,7 @@
36 36
           // {
37 37
             nativeBuildInputs = [pkgs.zig_0_10] ++ nativeBuildInputs;
38 38
           });
39
+      writeZsh = pkgs.writers.makeScriptWriter {interpreter = "${pkgs.zsh}/bin/zsh";};
39 40
       socat = pkgs.socat;
40 41
     in {
41 42
       devShells.default = pkgs.mkShell {
... ...
@@ -54,5 +55,12 @@
54 55
           platforms = platforms.linux ++ platforms.darwin;
55 56
         };
56 57
       };
58
+      apps.do-test = {
59
+        type = "app";
60
+        program = toString (writeZsh "test.zsh" ''
61
+          PATH="$PATH:${self.packages.${system}.default}/bin:${socat}/bin"
62
+          ${(builtins.readFile ./test.zsh)}
63
+        '');
64
+      };
57 65
     });
58 66
 }
... ...
@@ -1,4 +1,3 @@
1
-#!/usr/bin/env zsh
2 1
 
3 2
 # set -x
4 3
 set -eu -o pipefail