diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 3be82a3..a0ec3f7 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -10,7 +10,6 @@ on: branches: [ "main" ] jobs: - build: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/nix.yaml b/.github/workflows/nix.yaml new file mode 100644 index 0000000..ecd15b8 --- /dev/null +++ b/.github/workflows/nix.yaml @@ -0,0 +1,19 @@ +name: "Test" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: DeterminateSystems/nix-installer-action@main + + - uses: DeterminateSystems/magic-nix-cache-action@main + + - run: nix flake check -L diff --git a/flake.nix b/flake.nix index b3115af..b2dec9f 100644 --- a/flake.nix +++ b/flake.nix @@ -73,8 +73,10 @@ "-m 4G" "-vga none" "-device virtio-gpu-pci" - #"-device virtio-vga-gl" - #"-display gtk,gl=on" + # needs qemu_full: + # "-device virtio-vga-gl" + # "-display egl-headless,gl=core" + # "-display gtk,gl=on" ]; }; @@ -87,7 +89,7 @@ # bash '' cd ${./.} - go test -short -v 2>&1 | tee -a "$HOME/test.log" + go test -v 2>&1 | tee -a "$HOME/test.log" echo $? > "$HOME/test-finished" hyprctl dispatch exit ''; @@ -102,9 +104,7 @@ # bash '' if [ "$(tty)" = "/dev/tty1" ]; then - mkdir -p $HOME/.config/hypr - cp ${hyprlandConf} $HOME/.config/hypr/hyprland.conf - Hyprland + Hyprland --config ${hyprlandConf} fi ''; }; diff --git a/request_test.go b/request_test.go index bb86d61..e05caf9 100644 --- a/request_test.go +++ b/request_test.go @@ -165,7 +165,6 @@ func TestDispatch(t *testing.T) { if testing.Short() { t.Skip("skip slow test") } - // Testing if we can open at least the amount of instances we asked // Dispatch() to open. // The reason this test exist is because Hyprland has a hidden @@ -175,9 +174,9 @@ func TestDispatch(t *testing.T) { // batch commands is working as expected. // See also: prepareRequests function and MAX_COMMANDS const const want = 35 - const retries = 10 + const retries = 15 t.Run(fmt.Sprintf("test_opening_%d_kitty_instances", want), func(t *testing.T) { - must1(c.Dispatch(genParams("exec kitty sh -c 'sleep 10 && exit 0'", want)...)) + must1(c.Dispatch(genParams(fmt.Sprintf("exec kitty sh -c 'sleep %d && exit 0'", retries), want)...)) awid := must1(c.ActiveWorkspace()).Id got := 0 for i := 0; i < retries; i++ {