Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

ci(webv2): add lint build and test gates

joshistoastb8d6980e7fc2
diff --git a/.github/actions/install-frontend-deps/action.yml b/.github/actions/install-frontend-deps/action.yml
index 1e6d3e6be8..530ab0a722 100644
--- a/.github/actions/install-frontend-deps/action.yml
+++ b/.github/actions/install-frontend-deps/action.yml
@@ -1,5 +1,10 @@
name: install frontend dependencies
description: Installs frontend dependencies with pnpm, with caching
+inputs:
+ working-directory:
+ description: Directory to install dependencies in
+ required: false
+ default: invokeai/frontend/web
runs:
using: 'composite'
steps:
@@ -30,4 +35,4 @@ runs:
- name: install frontend dependencies
run: pnpm install --prefer-frozen-lockfile
shell: bash
- working-directory: invokeai/frontend/web
+ working-directory: ${{ inputs.working-directory }}
diff --git a/.github/workflows/frontend-checks.yml b/.github/workflows/frontend-checks.yml
index b36fbeb650..c287d45529 100644
--- a/.github/workflows/frontend-checks.yml
+++ b/.github/workflows/frontend-checks.yml
@@ -30,14 +30,13 @@ on:
type: boolean
default: true
-defaults:
- run:
- working-directory: invokeai/frontend/web
-
jobs:
frontend-checks:
runs-on: ubuntu-latest
timeout-minutes: 10 # expected run time: <2 min
+ defaults:
+ run:
+ working-directory: invokeai/frontend/web
steps:
- uses: actions/checkout@v6
@@ -94,3 +93,37 @@ jobs:
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' || inputs.always_run == true }}
run: 'pnpm lint:knip'
shell: bash
+
+ frontend-webv2-checks:
+ runs-on: ubuntu-latest
+ timeout-minutes: 10 # expected run time: <2 min
+ defaults:
+ run:
+ working-directory: invokeai/frontend/webv2
+ steps:
+ - uses: actions/checkout@v6
+
+ - name: check for changed webv2 files
+ if: ${{ inputs.always_run != true }}
+ id: changed-files
+ uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96
+ with:
+ files_yaml: |
+ webv2:
+ - 'invokeai/frontend/webv2/**'
+
+ - name: install dependencies
+ if: ${{ steps.changed-files.outputs.webv2_any_changed == 'true' || inputs.always_run == true }}
+ uses: ./.github/actions/install-frontend-deps
+ with:
+ working-directory: invokeai/frontend/webv2
+
+ - name: lint
+ if: ${{ steps.changed-files.outputs.webv2_any_changed == 'true' || inputs.always_run == true }}
+ run: 'pnpm run lint'
+ shell: bash
+
+ - name: build
+ if: ${{ steps.changed-files.outputs.webv2_any_changed == 'true' || inputs.always_run == true }}
+ run: 'pnpm run build'
+ shell: bash
diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/frontend-tests.yml
index abb1fb8419..824ec08203 100644
--- a/.github/workflows/frontend-tests.yml
+++ b/.github/workflows/frontend-tests.yml
@@ -30,14 +30,13 @@ on:
type: boolean
default: true
-defaults:
- run:
- working-directory: invokeai/frontend/web
-
jobs:
frontend-tests:
runs-on: ubuntu-latest
timeout-minutes: 10 # expected run time: <2 min
+ defaults:
+ run:
+ working-directory: invokeai/frontend/web
steps:
- uses: actions/checkout@v6
@@ -63,3 +62,32 @@ jobs:
if: ${{ steps.changed-files.outputs.frontend_any_changed == 'true' || inputs.always_run == true }}
run: 'pnpm test:no-watch'
shell: bash
+
+ frontend-webv2-tests:
+ runs-on: ubuntu-latest
+ timeout-minutes: 10 # expected run time: <2 min
+ defaults:
+ run:
+ working-directory: invokeai/frontend/webv2
+ steps:
+ - uses: actions/checkout@v6
+
+ - name: check for changed webv2 files
+ if: ${{ inputs.always_run != true }}
+ id: changed-files
+ uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96
+ with:
+ files_yaml: |
+ webv2:
+ - 'invokeai/frontend/webv2/**'
+
+ - name: install dependencies
+ if: ${{ steps.changed-files.outputs.webv2_any_changed == 'true' || inputs.always_run == true }}
+ uses: ./.github/actions/install-frontend-deps
+ with:
+ working-directory: invokeai/frontend/webv2
+
+ - name: vitest
+ if: ${{ steps.changed-files.outputs.webv2_any_changed == 'true' || inputs.always_run == true }}
+ run: 'pnpm test'
+ shell: bash