Skip to content
Open
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
42 changes: 30 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,42 @@ jobs:
path: shared/dist
key: ${{ runner.os }}-shared-build-${{ github.sha }}

- name: Install Dependencies and Link Shared
# Step 1: Install dependencies at the root (for all workspaces: shared + server)
- name: Install All Dependencies (Workspace)
run: |
# Install shared package
cd shared
npm install
npm run build
npm link
npm ci
# Optional debug info
npm list openai --depth=0 || true

# Step 2: Build Shared + Server
- name: Build Shared
run: npm run build:shared

- name: Build Server
run: npm run build:server

# Install server package and link to shared
cd ../server
npm install --ignore-scripts
npm link @polylink/shared
# Step 3: Create a self-contained production install for the **server workspace**
- name: Production install (server workspace)
run: |
# Run from the repo root β€” not inside `server`
npm ci --omit=dev \
--workspace=server \
--include-workspace-root \
--install-strategy=nested

# Critical check for the required file
test -f server/node_modules/@langchain/langgraph/prebuilt.js || {
echo "❌ prebuilt.js missing!"; exit 1;
}

- name: Run lint
run: cd server && npm run lint

- name: Build Server
run: cd server && npm run build
# Step 4: Create artifact with server contents
- name: Create artifact
run: |
cd server
zip -r release.zip dist node_modules package.json package-lock.json

# Placeholder for future server-side testing
# - name: Run Server Tests
Expand Down
37 changes: 32 additions & 5 deletions .github/workflows/main_polylink.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
with:
# Use at least Node 18 (or Node 20)
node-version: "20.x"
cache: "npm"

# Step 3: Install dependencies at the root (for all workspaces: shared + server)
- name: Install All Dependencies (Workspace)
Expand All @@ -44,14 +45,42 @@ jobs:
rm -rf node_modules
# Install ONLY production dependencies, pinned by the root lock file
npm ci --only=production

# Debug: List all top-level node_modules folders
echo "πŸ“¦ Top-level node_modules contents:"
ls -la node_modules/

# Debug: Check if @langchain folder exists and its contents
echo "πŸ” @langchain folder contents:"
ls -la node_modules/@langchain/ || echo "❌ @langchain folder not found!"

# Debug: Check langgraph folder specifically
echo "πŸ” langgraph folder contents:"
ls -la node_modules/@langchain/langgraph/ || echo "❌ langgraph folder not found!"

# Debug: Check prebuilt folder specifically
echo "πŸ” prebuilt folder contents:"
ls -la node_modules/@langchain/langgraph/prebuilt/ || echo "❌ prebuilt folder not found!"

# Double-check what version of openai we actually have
npm list openai --depth=0 || true

# Step 6: Create final deployment artifact with dist + node_modules + package.json
# 2. Quick sanity check
test -f node_modules/@langchain/langgraph/prebuilt/index.js && \
echo "βœ… prebuilt sub-path present" || \
(echo "❌ prebuilt sub-path missing!")

# 3. Sanity-check that the file Node will require is present
test -f node_modules/@langchain/langgraph/prebuilt.js && \
echo "βœ… prebuilt.js present" || \
(echo "❌ @langchain/langgraph/prebuilt.js missing!")

# Step 6: Create final deployment artifact
- name: Create zip artifact
run: |
cd server
zip -r release.zip dist node_modules package.json
# Include package-lock.json in the deployment
zip -r release.zip dist node_modules package.json package-lock.json .npmrc

# Step 7: Show ZIP contents (for debugging)
- name: Show ZIP contents
Expand All @@ -73,7 +102,7 @@ jobs:
name: "Production"
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
permissions:
id-token: write # required for requesting the JWT
id-token: write

steps:
- name: Download artifact from build job
Expand All @@ -100,6 +129,4 @@ jobs:
with:
app-name: "PolyLink"
slot-name: "Production"
# We now have node_modules already included,
# so Azure won't attempt to re-install anything.
package: ./server-build
Loading
Loading