add headless app for tests on CI

This commit is contained in:
Henry Hiles 2026-11-06 21:44:03 -05:00
commit 7bbe2cccf6
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
3 changed files with 72 additions and 21 deletions

28
.github/workflows/e2e.yml vendored Normal file
View 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
View file

@ -27,11 +27,11 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1794004794,
"narHash": "sha256-fNmKraRLE963JuV3K4giays4KcOVCGpjvFuEG2E0hmE=",
"lastModified": 1794063651,
"narHash": "sha256-EXBj8a1aBO99CpMZWGqf6z6D/LFdsW/aB2xfDDrJuHw=",
"ref": "refs/heads/quad/fix/latest-event-in-thread-aggregation",
"rev": "35813f52748c31b0b10cc72e69dabef6a838c46a",
"revCount": 8067,
"rev": "40a4100ec8734d18f8baf8b0dcfea80b6944e90e",
"revCount": 8068,
"type": "git",
"url": "file:///home/quadradical/Documents/Code/continuwuity"
},

View file

@ -55,27 +55,50 @@
devShells.default = pkgs.callPackage ./devshell.nix { };
apps.e2e =
apps =
let
buildEnv = import ./build_env.nix { inherit pkgs lib; };
e2e = pkgs.writeShellApplication {
name = "nexus-e2e";
runtimeInputs =
buildEnv.packages
++ (with pkgs; [
# TEMPORARY: matrix-continuwuity, once the local fixes are released
inputs.continuwuity.packages.${system}.default
curl
dbus
]);
runtimeEnv = buildEnv.env;
text = builtins.readFile ./e2e.sh;
};
in
{
type = "app";
program = lib.getExe (
pkgs.writeShellApplication {
name = "nexus-e2e";
runtimeInputs =
buildEnv.packages
++ (with pkgs; [
# TEMPORARY: matrix-continuwuity, once the local fixes are released
inputs.continuwuity.packages.${system}.default
curl
dbus
]);
runtimeEnv = buildEnv.env;
text = builtins.readFile ./e2e.sh;
}
);
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} "$@"
'';
}
);
};
};
};