Refactor CI workflows by removing redundant permission fixes and sticky disk mounts; streamline dependency installation and build steps with Turbo caching.

This commit is contained in:
dal 2025-08-21 14:52:37 -06:00
parent 3e6f0f05b2
commit 72e3b18aec
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
3 changed files with 20 additions and 86 deletions

View File

@ -32,31 +32,16 @@ jobs:
node-version: 22
cache: 'pnpm'
- name: Fix pnpm store permissions
run: |
STORE_PATH=$(pnpm store path --silent)
if [ -d "$STORE_PATH" ]; then
# Clear corrupted cache entries
find "$STORE_PATH" -type f ! -perm -u+r -delete 2>/dev/null || true
find "$STORE_PATH" -type d ! -perm -u+rx -delete 2>/dev/null || true
# Fix permissions on remaining files
sudo chown -R $(whoami):$(whoami) "$STORE_PATH" || true
chmod -R u+rw "$STORE_PATH" || true
fi
- name: Mount Turbo cache sticky disk
uses: useblacksmith/stickydisk@v1
with:
key: ${{ github.repository }}-turbo-cache
path: ./.turbo
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
run: pnpm install --frozen-lockfile
- name: Build all packages (excluding web)
run: pnpm build --filter='!@buster-app/web'
env:
NODE_ENV: production
TURBO_CACHE_DIR: .turbo
TURBO_TELEMETRY_DISABLED: 1
# Lint job - runs in parallel
lint:
@ -78,29 +63,15 @@ jobs:
node-version: 22
cache: 'pnpm'
- name: Fix pnpm store permissions
run: |
STORE_PATH=$(pnpm store path --silent)
if [ -d "$STORE_PATH" ]; then
# Clear corrupted cache entries
find "$STORE_PATH" -type f ! -perm -u+r -delete 2>/dev/null || true
find "$STORE_PATH" -type d ! -perm -u+rx -delete 2>/dev/null || true
# Fix permissions on remaining files
sudo chown -R $(whoami):$(whoami) "$STORE_PATH" || true
chmod -R u+rw "$STORE_PATH" || true
fi
- name: Mount Turbo cache sticky disk
uses: useblacksmith/stickydisk@v1
with:
key: ${{ github.repository }}-turbo-cache
path: ./.turbo
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
run: pnpm install --frozen-lockfile
- name: Lint all packages (excluding web)
run: pnpm lint --filter='!@buster-app/web'
env:
TURBO_CACHE_DIR: .turbo
TURBO_TELEMETRY_DISABLED: 1
# Test job - runs after build completes
test:
@ -123,34 +94,22 @@ jobs:
node-version: 22
cache: 'pnpm'
- name: Fix pnpm store permissions
run: |
STORE_PATH=$(pnpm store path --silent)
if [ -d "$STORE_PATH" ]; then
# Clear corrupted cache entries
find "$STORE_PATH" -type f ! -perm -u+r -delete 2>/dev/null || true
find "$STORE_PATH" -type d ! -perm -u+rx -delete 2>/dev/null || true
# Fix permissions on remaining files
sudo chown -R $(whoami):$(whoami) "$STORE_PATH" || true
chmod -R u+rw "$STORE_PATH" || true
fi
- name: Mount Turbo cache sticky disk
uses: useblacksmith/stickydisk@v1
with:
key: ${{ github.repository }}-turbo-cache
path: ./.turbo
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
run: pnpm install --frozen-lockfile
- name: Build required packages
run: pnpm build --filter='!@buster-app/web'
env:
NODE_ENV: production
TURBO_CACHE_DIR: .turbo
TURBO_TELEMETRY_DISABLED: 1
- name: Run all unit tests (excluding web)
run: pnpm test:unit --filter='!@buster-app/web'
env:
TURBO_CACHE_DIR: .turbo
TURBO_TELEMETRY_DISABLED: 1
- name: Upload test coverage
uses: actions/upload-artifact@v4

View File

@ -42,23 +42,9 @@ jobs:
node-version: 22
cache: 'pnpm'
- name: Fix pnpm store permissions
run: |
STORE_PATH=$(pnpm store path --silent)
if [ -d "$STORE_PATH" ]; then
sudo chown -R $(whoami):$(whoami) "$STORE_PATH" || true
chmod -R u+rw "$STORE_PATH" || true
fi
- name: Install bun
run: npm install -g bun@1.2.15
- name: Mount Turbo cache sticky disk
uses: useblacksmith/stickydisk@v1
with:
key: ${{ github.repository }}-turbo-cache
path: ./.turbo
- name: Mount Docker buildkit sticky disk
uses: useblacksmith/stickydisk@v1
with:
@ -68,17 +54,20 @@ jobs:
- name: Install dependencies
run: |
echo "📦 Installing dependencies with pnpm..."
pnpm install --frozen-lockfile --prefer-offline
pnpm install --frozen-lockfile
- name: Build with Turbo
run: |
echo "🔨 Building server with Turbo (using sticky disk cache)..."
pnpm turbo run build --filter=@buster-app/server
echo "🔨 Building server with Turbo..."
# Build with optimized settings for Docker
pnpm turbo run build --filter=@buster-app/server...
echo "✅ Build complete!"
env:
NODE_ENV: production
DOCKER_BUILD: true
CI: true
TURBO_CACHE_DIR: .turbo
TURBO_TELEMETRY_DISABLED: 1
- name: Build server bundle
run: |

View File

@ -27,23 +27,9 @@ jobs:
with:
node-version: 22
cache: 'pnpm'
- name: Fix pnpm store permissions
run: |
STORE_PATH=$(pnpm store path --silent)
if [ -d "$STORE_PATH" ]; then
sudo chown -R $(whoami):$(whoami) "$STORE_PATH" || true
chmod -R u+rw "$STORE_PATH" || true
fi
- name: Mount Turbo cache sticky disk
uses: useblacksmith/stickydisk@v1
with:
key: ${{ github.repository }}-turbo-cache
path: ./.turbo
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
run: pnpm install --frozen-lockfile
- name: 🚀 Deploy to ${{ github.ref_name == 'main' && 'Production' || 'Staging' }}
env: