add headless app for tests on CI
This commit is contained in:
parent
d3a6b51410
commit
91c954da14
3 changed files with 72 additions and 21 deletions
28
.github/workflows/e2e.yml
vendored
Normal file
28
.github/workflows/e2e.yml
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
name: "End-to-end tests"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["main"]
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
e2e:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Lix GHA Installer Action
|
||||||
|
uses: samueldr/lix-gha-installer-action@v2026-02-22
|
||||||
|
with:
|
||||||
|
extra_nix_config: experimental-features = nix-command flakes flake-self-attrs
|
||||||
|
|
||||||
|
- name: Generate code
|
||||||
|
run: nix develop --command bash -c "flutter pub get && dart scripts/generate.dart && flutter pub run build_runner build"
|
||||||
|
|
||||||
|
- name: Run end-to-end tests
|
||||||
|
run: nix run .#e2e-headless
|
||||||
8
flake.lock
generated
8
flake.lock
generated
|
|
@ -27,11 +27,11 @@
|
||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1794004794,
|
"lastModified": 1794063651,
|
||||||
"narHash": "sha256-fNmKraRLE963JuV3K4giays4KcOVCGpjvFuEG2E0hmE=",
|
"narHash": "sha256-EXBj8a1aBO99CpMZWGqf6z6D/LFdsW/aB2xfDDrJuHw=",
|
||||||
"ref": "refs/heads/quad/fix/latest-event-in-thread-aggregation",
|
"ref": "refs/heads/quad/fix/latest-event-in-thread-aggregation",
|
||||||
"rev": "35813f52748c31b0b10cc72e69dabef6a838c46a",
|
"rev": "40a4100ec8734d18f8baf8b0dcfea80b6944e90e",
|
||||||
"revCount": 8067,
|
"revCount": 8068,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "file:///home/quadradical/Documents/Code/continuwuity"
|
"url": "file:///home/quadradical/Documents/Code/continuwuity"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -55,14 +55,10 @@
|
||||||
|
|
||||||
devShells.default = pkgs.callPackage ./devshell.nix { };
|
devShells.default = pkgs.callPackage ./devshell.nix { };
|
||||||
|
|
||||||
apps.e2e =
|
apps =
|
||||||
let
|
let
|
||||||
buildEnv = import ./build_env.nix { inherit pkgs lib; };
|
buildEnv = import ./build_env.nix { inherit pkgs lib; };
|
||||||
in
|
e2e = pkgs.writeShellApplication {
|
||||||
{
|
|
||||||
type = "app";
|
|
||||||
program = lib.getExe (
|
|
||||||
pkgs.writeShellApplication {
|
|
||||||
name = "nexus-e2e";
|
name = "nexus-e2e";
|
||||||
runtimeInputs =
|
runtimeInputs =
|
||||||
buildEnv.packages
|
buildEnv.packages
|
||||||
|
|
@ -74,10 +70,37 @@
|
||||||
]);
|
]);
|
||||||
runtimeEnv = buildEnv.env;
|
runtimeEnv = buildEnv.env;
|
||||||
text = builtins.readFile ./e2e.sh;
|
text = builtins.readFile ./e2e.sh;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
e2e = {
|
||||||
|
type = "app";
|
||||||
|
program = lib.getExe e2e;
|
||||||
|
};
|
||||||
|
|
||||||
|
e2e-headless = {
|
||||||
|
type = "app";
|
||||||
|
program = lib.getExe (
|
||||||
|
pkgs.writeShellApplication {
|
||||||
|
name = "nexus-e2e-headless";
|
||||||
|
runtimeInputs = [ pkgs.cage ];
|
||||||
|
runtimeEnv = {
|
||||||
|
WLR_BACKENDS = "headless";
|
||||||
|
__EGL_VENDOR_LIBRARY_FILENAMES = "${pkgs.mesa}/share/glvnd/egl_vendor.d/50_mesa.json";
|
||||||
|
};
|
||||||
|
text = ''
|
||||||
|
unset DISPLAY WAYLAND_DISPLAY
|
||||||
|
# Wayland needs one, which CI may not have
|
||||||
|
XDG_RUNTIME_DIR="''${XDG_RUNTIME_DIR:-$(mktemp -d)}"
|
||||||
|
export XDG_RUNTIME_DIR
|
||||||
|
|
||||||
|
exec cage -- ${lib.getExe e2e} "$@"
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
flake.nixosModules.default = import ./module.nix self;
|
flake.nixosModules.default = import ./module.nix self;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue