Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions .github/workflows/bundle-desktop-intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,6 @@ jobs:
cd ui/desktop
npm version ${{ inputs.version }} --no-git-tag-version --allow-same-version

# Pre-build cleanup to ensure enough disk space
- name: Pre-build cleanup
run: |
source ./bin/activate-hermit
echo "Performing pre-build cleanup..."
# Clean npm cache
npm cache clean --force || true
# Clean any previous build artifacts
rm -rf target || true
# Clean Homebrew cache
brew cleanup || true
# Remove unnecessary large directories
rm -rf ~/Library/Caches/* || true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove this whole step now, all that's left is activate hermit but that would only be until the end of the step execution, so effectively all it's doing is dh -h

# Check disk space after cleanup
df -h

- name: Cache Cargo registry
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # pin@v3
with:
Expand Down Expand Up @@ -150,6 +134,16 @@ jobs:
cp temporal-service/temporal-service ui/desktop/src/bin/temporal-service
cp bin/temporal ui/desktop/src/bin/temporal

- name: Cache npm dependencies
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # pin@v3
with:
path: |
ui/desktop/node_modules
.hermit/node/cache
key: intel-npm-cache-v1-${{ runner.os }}-${{ hashFiles('ui/desktop/package-lock.json') }}
restore-keys: |
intel-npm-cache-v1-${{ runner.os }}-

- name: Install dependencies
run: source ../../bin/activate-hermit && npm ci
working-directory: ui/desktop
Expand Down
31 changes: 10 additions & 21 deletions .github/workflows/bundle-desktop-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,26 +78,6 @@ jobs:
dpkg-dev \
protobuf-compiler

- name: Pre-build cleanup
run: |
echo "Performing aggressive pre-build cleanup..."
# Clean npm cache
npm cache clean --force || true
# Clean any previous build artifacts
rm -rf target || true
# Clean Homebrew cache (if exists)
brew cleanup || true
# Remove unnecessary large directories
sudo rm -rf /usr/share/dotnet || true
sudo rm -rf /usr/local/lib/android || true
sudo rm -rf /opt/ghc || true
sudo rm -rf /usr/local/share/boost || true
# Clean apt cache
sudo apt-get clean || true
sudo apt-get autoremove -y || true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, just remove the whole step

# Check disk space after cleanup
df -h

- name: Activate hermit and set CARGO_HOME
run: |
source bin/activate-hermit
Expand Down Expand Up @@ -154,11 +134,20 @@ jobs:
chmod +x ui/desktop/src/bin/temporal-service
ls -la ui/desktop/src/bin/

- name: Cache npm dependencies
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # pin@v3
with:
path: |
ui/desktop/node_modules
.hermit/node/cache
key: linux-npm-cache-v1-${{ runner.os }}-${{ hashFiles('ui/desktop/package-lock.json') }}
restore-keys: |
linux-npm-cache-v1-${{ runner.os }}-

- name: Install npm dependencies
run: |
source ./bin/activate-hermit
cd ui/desktop
npm cache clean --force || true
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michaelneale do we need this npm cache clean with linux?

npm install
# Verify installation
ls -la node_modules/.bin/ | head -5
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/bundle-desktop-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ jobs:
path: |
node_modules
ui/desktop/node_modules
key: ${{ runner.os }}-build-desktop-windows-node22-${{ hashFiles('**/package-lock.json') }}
.hermit/node/cache
key: windows-npm-cache-v1-${{ runner.os }}-node22-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-desktop-windows-node22-
windows-npm-cache-v1-${{ runner.os }}-node22-

# Cache Cargo registry and git dependencies
- name: Cache Cargo registry
Expand Down
26 changes: 10 additions & 16 deletions .github/workflows/bundle-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,22 +107,6 @@ jobs:
cd ui/desktop
npm version "${VERSION}" --no-git-tag-version --allow-same-version

# Pre-build cleanup to ensure enough disk space
- name: Pre-build cleanup
run: |
source ./bin/activate-hermit
echo "Performing pre-build cleanup..."
# Clean npm cache
npm cache clean --force || true
# Clean any previous build artifacts
rm -rf target || true
# Clean Homebrew cache
brew cleanup || true
# Remove unnecessary large directories
rm -rf ~/Library/Caches/* || true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

# Check disk space after cleanup
df -h

- name: Cache Cargo registry
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # pin@v3
with:
Expand Down Expand Up @@ -191,6 +175,16 @@ jobs:
cp temporal-service/temporal-service ui/desktop/src/bin/temporal-service
cp bin/temporal ui/desktop/src/bin/temporal

- name: Cache npm dependencies
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # pin@v3
with:
path: |
ui/desktop/node_modules
.hermit/node/cache
key: macos-npm-cache-v1-${{ runner.os }}-${{ hashFiles('ui/desktop/package-lock.json') }}
restore-keys: |
macos-npm-cache-v1-${{ runner.os }}-

- name: Install dependencies
run: source ../../bin/activate-hermit && npm ci
working-directory: ui/desktop
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ jobs:
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # pin@v4

- name: Cache npm dependencies
uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # pin@v3
with:
path: |
ui/desktop/node_modules
.hermit/node/cache
key: ci-npm-cache-v1-${{ runner.os }}-${{ hashFiles('ui/desktop/package-lock.json') }}
restore-keys: |
ci-npm-cache-v1-${{ runner.os }}-

- name: Install Dependencies
run: source ../../bin/activate-hermit && npm ci
working-directory: ui/desktop
Expand All @@ -117,6 +127,10 @@ jobs:
run: source ../../bin/activate-hermit && npm run lint:check
working-directory: ui/desktop

- name: Run Tests
run: source ../../bin/activate-hermit && npm run test:run
working-directory: ui/desktop

# Faster Desktop App build for PRs only
bundle-desktop-unsigned:
uses: ./.github/workflows/bundle-desktop.yml
Expand Down
3 changes: 2 additions & 1 deletion ui/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@
"src/**/*.{ts,tsx}": [
"bash -c 'npm run typecheck'",
"eslint --fix --max-warnings 0 --no-warn-ignored",
"prettier --write"
"prettier --write",
"bash -c 'npm run test:run'"
],
"src/**/*.{css,json}": [
"prettier --write"
Expand Down
29 changes: 26 additions & 3 deletions ui/desktop/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,26 @@ vi.mock('./components/ModelAndProviderContext', () => ({

vi.mock('./contexts/ChatContext', () => ({
ChatProvider: ({ children }: { children: React.ReactNode }) => <>{children}</>,
useChatContext: () => ({
chat: {
id: 'test-id',
title: 'Test Chat',
messages: [],
messageHistoryIndex: 0,
recipeConfig: null,
},
setChat: vi.fn(),
resetChat: vi.fn(),
hasActiveSession: false,
setRecipeConfig: vi.fn(),
clearRecipeConfig: vi.fn(),
setRecipeParameters: vi.fn(),
clearRecipeParameters: vi.fn(),
draft: '',
setDraft: vi.fn(),
clearDraft: vi.fn(),
contextKey: 'hub',
}),
}));

vi.mock('./contexts/DraftContext', () => ({
Expand Down Expand Up @@ -212,7 +232,8 @@ describe('App Component - Brand New State', () => {

// Check that we navigated to "/" not "/welcome"
await waitFor(() => {
expect(window.location.hash).toBe('#/');
// In some environments, the hash might be empty or just "#"
expect(window.location.hash).toMatch(/^(#\/?|)$/);
});

// History should have been updated to "/"
Expand Down Expand Up @@ -260,7 +281,8 @@ describe('App Component - Brand New State', () => {

// Should stay at "/" since provider is configured
await waitFor(() => {
expect(window.location.hash).toBe('#/');
// In some environments, the hash might be empty or just "#"
expect(window.location.hash).toMatch(/^(#\/?|)$/);
});
});

Expand All @@ -285,7 +307,8 @@ describe('App Component - Brand New State', () => {

// App should still initialize and navigate to "/"
await waitFor(() => {
expect(window.location.hash).toBe('#/');
// In some environments, the hash might be empty or just "#"
expect(window.location.hash).toMatch(/^(#\/?|)$/);
});
});
});
Loading