Skip to content

Commit

Permalink
Merge pull request #29 from 21CSM/playwright-ci
Browse files Browse the repository at this point in the history
build(flake): add playwright-web-flake for integration testing

ci: add command to install playwright browsers

ci: add integration testing to build.yml
  • Loading branch information
21CSM authored Sep 21, 2024
2 parents dfb71fc + f959adc commit 0ed9f11
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ jobs:
nix develop -c pnpm install
- name: Run Unit Tests
run: |
nix develop -c pnpm run test:unit
nix develop -c pnpm run test:unit
- name: Run Integration Tests
run: |
nix develop -c pnpm run test:integration
69 changes: 68 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit 0ed9f11

Please sign in to comment.