From a899379022adbbc54740bb52909a099bd51893db Mon Sep 17 00:00:00 2001 From: 21CSM <81891917+21CSM@users.noreply.github.com> Date: Sat, 21 Sep 2024 00:35:03 -0400 Subject: [PATCH 1/2] ci: add unit testing to build.yml --- .github/workflows/build.yml | 11 +++++++---- .github/workflows/update-flake-lock.yml | 4 ++-- package.json | 5 +++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 73d7006..a603fea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Check flake health + - name: Check Flake Health uses: DeterminateSystems/flake-checker-action@v9 build: @@ -24,8 +24,11 @@ jobs: uses: actions/checkout@v4 - name: Install Nix uses: DeterminateSystems/nix-installer-action@v14 - - name: Run the Magic Nix Cache + - name: Run Magic Nix Cache uses: DeterminateSystems/magic-nix-cache-action@v8 - - name: Run Nix flake checks + - name: Run Nix Flake Checks run: | - nix flake check \ No newline at end of file + nix flake check + - name: Run Unit Tests + run: | + nix develop -c pnpm run test:unit \ No newline at end of file diff --git a/.github/workflows/update-flake-lock.yml b/.github/workflows/update-flake-lock.yml index d6b9a7b..8449fe4 100644 --- a/.github/workflows/update-flake-lock.yml +++ b/.github/workflows/update-flake-lock.yml @@ -19,9 +19,9 @@ jobs: uses: actions/checkout@v4 - name: Install Nix uses: DeterminateSystems/nix-installer-action@v14 - - name: Run the Magic Nix Cache + - name: Run Magic Nix Cache uses: DeterminateSystems/magic-nix-cache-action@v8 - - name: Check flake health + - name: Check Flake Health uses: DeterminateSystems/flake-checker-action@v9 - name: Update flake.lock uses: DeterminateSystems/update-flake-lock@v24 diff --git a/package.json b/package.json index 0b27c82..8796d32 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,9 @@ "lint": "prettier --check . && eslint .", "format": "prettier --write .", "test:integration": "playwright test", - "test:integration:ui": "playwright test --ui", - "test:unit": "vitest" + "test:integration:ui": "playwright test --ui", + "test:unit": "vitest --run", + "test:unit:watch": "vitest" }, "devDependencies": { "@playwright/test": "^1.28.1", From 68fd158c3daae12b058d309ead28a231a9d0b591 Mon Sep 17 00:00:00 2001 From: 21CSM <81891917+21CSM@users.noreply.github.com> Date: Sat, 21 Sep 2024 00:44:39 -0400 Subject: [PATCH 2/2] ci: add step to install node modules --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a603fea..4868e02 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,6 +29,9 @@ jobs: - name: Run Nix Flake Checks run: | nix flake check + - name: Install Dependencies + run: | + nix develop -c pnpm install - name: Run Unit Tests run: | nix develop -c pnpm run test:unit \ No newline at end of file