diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 0000000..c374e64 --- /dev/null +++ b/.github/workflows/e2e.yml @@ -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 diff --git a/flake.lock b/flake.lock index 6508ef8..5dc84b3 100644 --- a/flake.lock +++ b/flake.lock @@ -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" }, diff --git a/linux/nix/default.nix b/linux/nix/default.nix index 3d2f7b2..3d3b395 100644 --- a/linux/nix/default.nix +++ b/linux/nix/default.nix @@ -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} "$@" + ''; + } + ); + }; }; };