Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.github/nix: init #2

Merged
merged 3 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
branches: [ "main" ]

jobs:

build:
runs-on: ubuntu-latest
steps:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/nix.yaml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 6 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
];
};

Expand All @@ -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
'';
Expand All @@ -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
'';
};
Expand Down
5 changes: 2 additions & 3 deletions request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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++ {
Expand Down
Loading