ci: optimize build workflows and caching
This commit is contained in:
parent
2e53b3cbad
commit
b03c9401c4
11 changed files with 109 additions and 15 deletions
11
.github/workflows/build-native.yml
vendored
11
.github/workflows/build-native.yml
vendored
|
|
@ -108,6 +108,7 @@ jobs:
|
|||
with:
|
||||
node-version: "24"
|
||||
registry-url: "https://registry.npmjs.org"
|
||||
cache: "npm"
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
|
|
@ -199,6 +200,16 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Cache TypeScript incremental state
|
||||
uses: useblacksmith/cache@v5
|
||||
with:
|
||||
path: |
|
||||
*.tsbuildinfo
|
||||
packages/*/*.tsbuildinfo
|
||||
key: tsbuild-${{ runner.os }}-${{ hashFiles('package-lock.json', 'tsconfig*.json', 'packages/*/tsconfig.json') }}
|
||||
restore-keys: |
|
||||
tsbuild-${{ runner.os }}-
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
|
|
|
|||
74
.github/workflows/ci.yml
vendored
74
.github/workflows/ci.yml
vendored
|
|
@ -29,6 +29,7 @@ jobs:
|
|||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
outputs:
|
||||
docs-only: ${{ steps.check.outputs.docs-only }}
|
||||
portability-changed: ${{ steps.check.outputs.portability-changed }}
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
|
|
@ -59,6 +60,15 @@ jobs:
|
|||
echo "Non-docs files changed:"
|
||||
echo "$NON_DOCS"
|
||||
fi
|
||||
PORTABILITY=$(echo "$NON_DOCS" | grep -E '^(src/|packages/|native/|scripts/|web/|package\.json$|package-lock\.json$|web/package-lock\.json$|tsconfig[^/]*\.json$|packages/.*/tsconfig\.json$)' || true)
|
||||
if [ -n "$PORTABILITY" ]; then
|
||||
echo "portability-changed=true" >> "$GITHUB_OUTPUT"
|
||||
echo "Portability-relevant files changed:"
|
||||
echo "$PORTABILITY"
|
||||
else
|
||||
echo "portability-changed=false" >> "$GITHUB_OUTPUT"
|
||||
echo "::notice::No portability-relevant changes detected — skipping portability matrix jobs"
|
||||
fi
|
||||
|
||||
docs-check:
|
||||
timeout-minutes: 5
|
||||
|
|
@ -139,8 +149,18 @@ jobs:
|
|||
nextjs-${{ runner.os }}-${{ hashFiles('web/package-lock.json') }}-
|
||||
nextjs-${{ runner.os }}-
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
- name: Cache TypeScript incremental state
|
||||
uses: useblacksmith/cache@v5
|
||||
with:
|
||||
path: |
|
||||
*.tsbuildinfo
|
||||
packages/*/*.tsbuildinfo
|
||||
key: tsbuild-${{ runner.os }}-${{ hashFiles('package-lock.json', 'tsconfig*.json', 'packages/*/tsconfig.json') }}
|
||||
restore-keys: |
|
||||
tsbuild-${{ runner.os }}-
|
||||
|
||||
- name: Build core
|
||||
run: npm run build:core
|
||||
|
||||
- name: Build web host
|
||||
run: npm run build:web-host
|
||||
|
|
@ -179,16 +199,35 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
# Integration tests need the same compiled artifacts as the build job:
|
||||
# - dist/loader.js and packages/pi-coding-agent/dist/** from `npm run build`
|
||||
# Integration tests need core compiled artifacts:
|
||||
# - dist/loader.js and packages/pi-coding-agent/dist/** from `npm run build:core`
|
||||
# - web/node_modules/.bin/next for tests that shell `build:web-host` at runtime
|
||||
# Duplicating the build here (instead of sharing artifacts via needs: build)
|
||||
# Duplicating the core build here (instead of sharing artifacts via needs: build)
|
||||
# preserves wall-clock parallelism with the build job — see PR #4093.
|
||||
- name: Install web host dependencies
|
||||
run: npm --prefix web ci
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
- name: Cache Next.js build
|
||||
uses: useblacksmith/cache@v5
|
||||
with:
|
||||
path: web/.next/cache
|
||||
key: nextjs-${{ runner.os }}-${{ hashFiles('web/package-lock.json') }}-${{ hashFiles('web/app/**', 'web/components/**', 'web/lib/**', 'web/hooks/**') }}
|
||||
restore-keys: |
|
||||
nextjs-${{ runner.os }}-${{ hashFiles('web/package-lock.json') }}-
|
||||
nextjs-${{ runner.os }}-
|
||||
|
||||
- name: Cache TypeScript incremental state
|
||||
uses: useblacksmith/cache@v5
|
||||
with:
|
||||
path: |
|
||||
*.tsbuildinfo
|
||||
packages/*/*.tsbuildinfo
|
||||
key: tsbuild-${{ runner.os }}-${{ hashFiles('package-lock.json', 'tsconfig*.json', 'packages/*/tsconfig.json') }}
|
||||
restore-keys: |
|
||||
tsbuild-${{ runner.os }}-
|
||||
|
||||
- name: Build core
|
||||
run: npm run build:core
|
||||
|
||||
- name: Run integration tests
|
||||
run: npm run test:integration
|
||||
|
|
@ -197,7 +236,8 @@ jobs:
|
|||
timeout-minutes: 25
|
||||
needs: detect-changes
|
||||
if: >-
|
||||
needs.detect-changes.outputs.docs-only != 'true'
|
||||
needs.detect-changes.outputs.docs-only != 'true' &&
|
||||
needs.detect-changes.outputs.portability-changed == 'true'
|
||||
runs-on: blacksmith-4vcpu-windows-2025
|
||||
|
||||
steps:
|
||||
|
|
@ -213,8 +253,18 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
- name: Cache TypeScript incremental state
|
||||
uses: useblacksmith/cache@v5
|
||||
with:
|
||||
path: |
|
||||
*.tsbuildinfo
|
||||
packages/*/*.tsbuildinfo
|
||||
key: tsbuild-${{ runner.os }}-${{ hashFiles('package-lock.json', 'tsconfig*.json', 'packages/*/tsconfig.json') }}
|
||||
restore-keys: |
|
||||
tsbuild-${{ runner.os }}-
|
||||
|
||||
- name: Build core
|
||||
run: npm run build:core
|
||||
|
||||
- name: Typecheck extensions
|
||||
run: npm run typecheck:extensions
|
||||
|
|
@ -233,7 +283,9 @@ jobs:
|
|||
rtk-portability:
|
||||
timeout-minutes: 20
|
||||
needs: detect-changes
|
||||
if: needs.detect-changes.outputs.docs-only != 'true'
|
||||
if: >-
|
||||
needs.detect-changes.outputs.docs-only != 'true' &&
|
||||
needs.detect-changes.outputs.portability-changed == 'true'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
|
|
|||
27
.github/workflows/pipeline.yml
vendored
27
.github/workflows/pipeline.yml
vendored
|
|
@ -54,8 +54,21 @@ jobs:
|
|||
nextjs-${{ runner.os }}-${{ hashFiles('web/package-lock.json') }}-
|
||||
nextjs-${{ runner.os }}-
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
- name: Cache TypeScript incremental state
|
||||
uses: useblacksmith/cache@v5
|
||||
with:
|
||||
path: |
|
||||
*.tsbuildinfo
|
||||
packages/*/*.tsbuildinfo
|
||||
key: tsbuild-${{ runner.os }}-${{ hashFiles('package-lock.json', 'tsconfig*.json', 'packages/*/tsconfig.json') }}
|
||||
restore-keys: |
|
||||
tsbuild-${{ runner.os }}-
|
||||
|
||||
- name: Build core
|
||||
run: npm run build:core
|
||||
|
||||
- name: Build web host
|
||||
run: npm run build:web-host
|
||||
|
||||
- name: Stamp dev version and sync platform packages
|
||||
id: stamp
|
||||
|
|
@ -175,6 +188,16 @@ jobs:
|
|||
nextjs-${{ runner.os }}-${{ hashFiles('web/package-lock.json') }}-
|
||||
nextjs-${{ runner.os }}-
|
||||
|
||||
- name: Cache TypeScript incremental state
|
||||
uses: useblacksmith/cache@v5
|
||||
with:
|
||||
path: |
|
||||
*.tsbuildinfo
|
||||
packages/*/*.tsbuildinfo
|
||||
key: tsbuild-${{ runner.os }}-${{ hashFiles('package-lock.json', 'tsconfig*.json', 'packages/*/tsconfig.json') }}
|
||||
restore-keys: |
|
||||
tsbuild-${{ runner.os }}-
|
||||
|
||||
- name: Run live LLM tests (optional)
|
||||
continue-on-error: true
|
||||
run: npm run test:live || echo "::warning::Live LLM tests failed — non-blocking, but worth investigating"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "gsd-pi",
|
||||
"version": "2.74.0",
|
||||
"version": "2.73.1",
|
||||
"description": "GSD — Get Shit Done coding agent",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
|
@ -49,7 +49,8 @@
|
|||
"build:rpc-client": "npm run build -w @gsd-build/rpc-client",
|
||||
"build:pi": "npm run build:native-pkg && npm run build:pi-tui && npm run build:pi-ai && npm run build:pi-agent-core && npm run build:pi-coding-agent",
|
||||
"build:mcp-server": "npm run build -w @gsd-build/mcp-server",
|
||||
"build": "npm run build:pi && npm run build:rpc-client && npm run build:mcp-server && tsc && npm run copy-resources && npm run copy-themes && npm run copy-export-html && node scripts/build-web-if-stale.cjs",
|
||||
"build:core": "npm run build:pi && npm run build:rpc-client && npm run build:mcp-server && tsc && npm run copy-resources && npm run copy-themes && npm run copy-export-html",
|
||||
"build": "npm run build:core && node scripts/build-web-if-stale.cjs",
|
||||
"stage:web-host": "node scripts/stage-web-standalone.cjs",
|
||||
"build:web-host": "npm --prefix web run build && npm run stage:web-host",
|
||||
"copy-resources": "node scripts/copy-resources.cjs",
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"incremental": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"incremental": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"incremental": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"incremental": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"incremental": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"incremental": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
"rootDir": "src",
|
||||
"strict": true,
|
||||
"declaration": true,
|
||||
"incremental": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue