diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4868e02..c4d6b14 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,4 +34,7 @@ jobs: nix develop -c pnpm install - name: Run Unit Tests run: | - nix develop -c pnpm run test:unit \ No newline at end of file + nix develop -c pnpm run test:unit + - name: Run Integration Tests + run: | + nix develop -c pnpm run test:integration \ No newline at end of file diff --git a/flake.lock b/flake.lock index f8cec64..5277ece 100644 --- a/flake.lock +++ b/flake.lock @@ -18,6 +18,24 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1726755586, @@ -34,10 +52,44 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1691371061, + "narHash": "sha256-BxPbPVlBIoneaXIBiHd0LVzA+L4nmvFCNBU6TmQAiMM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5068bc8fe943bde3c446326da8d0ca9c93d5a682", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "playwright": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1726878103, + "narHash": "sha256-6j8gDbPS8d8jSgo+wBCYKH3/JWrSf8VTueoAC1iV2PM=", + "owner": "pietdevries94", + "repo": "playwright-web-flake", + "rev": "03a85b72fa2d1f764118c3544a5850bec9989555", + "type": "github" + }, + "original": { + "owner": "pietdevries94", + "repo": "playwright-web-flake", + "type": "github" + } + }, "root": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "playwright": "playwright" } }, "systems": { @@ -54,6 +106,21 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index eab1cb8..eb13b41 100644 --- a/flake.nix +++ b/flake.nix @@ -4,20 +4,32 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; + playwright.url = "github:pietdevries94/playwright-web-flake"; }; - outputs = { self, nixpkgs, flake-utils }: + outputs = { self, nixpkgs, flake-utils, playwright }: flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs { inherit system; }; + overlay = final: prev: { + inherit (playwright.packages.${system}) playwright-test playwright-driver; + }; + pkgs = import nixpkgs { + inherit system; + overlays = [ overlay ]; + }; buildInputs = with pkgs; [ nodejs_22 pnpm + playwright-test ]; in { devShells.default = pkgs.mkShell { inherit buildInputs; + shellHook = '' + export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 + export PLAYWRIGHT_BROWSERS_PATH="${pkgs.playwright-driver.browsers}" + ''; }; checks.default = pkgs.runCommand "check-env" {