mirror of https://github.com/buster-so/buster.git
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:
parent
3e6f0f05b2
commit
72e3b18aec
|
@ -32,31 +32,16 @@ jobs:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
cache: 'pnpm'
|
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
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile --prefer-offline
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build all packages (excluding web)
|
- name: Build all packages (excluding web)
|
||||||
run: pnpm build --filter='!@buster-app/web'
|
run: pnpm build --filter='!@buster-app/web'
|
||||||
env:
|
env:
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
|
TURBO_CACHE_DIR: .turbo
|
||||||
|
TURBO_TELEMETRY_DISABLED: 1
|
||||||
|
|
||||||
# Lint job - runs in parallel
|
# Lint job - runs in parallel
|
||||||
lint:
|
lint:
|
||||||
|
@ -78,29 +63,15 @@ jobs:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
cache: 'pnpm'
|
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
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile --prefer-offline
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Lint all packages (excluding web)
|
- name: Lint all packages (excluding web)
|
||||||
run: pnpm lint --filter='!@buster-app/web'
|
run: pnpm lint --filter='!@buster-app/web'
|
||||||
|
env:
|
||||||
|
TURBO_CACHE_DIR: .turbo
|
||||||
|
TURBO_TELEMETRY_DISABLED: 1
|
||||||
|
|
||||||
# Test job - runs after build completes
|
# Test job - runs after build completes
|
||||||
test:
|
test:
|
||||||
|
@ -123,34 +94,22 @@ jobs:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
cache: 'pnpm'
|
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
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile --prefer-offline
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build required packages
|
- name: Build required packages
|
||||||
run: pnpm build --filter='!@buster-app/web'
|
run: pnpm build --filter='!@buster-app/web'
|
||||||
env:
|
env:
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
|
TURBO_CACHE_DIR: .turbo
|
||||||
|
TURBO_TELEMETRY_DISABLED: 1
|
||||||
|
|
||||||
- name: Run all unit tests (excluding web)
|
- name: Run all unit tests (excluding web)
|
||||||
run: pnpm test:unit --filter='!@buster-app/web'
|
run: pnpm test:unit --filter='!@buster-app/web'
|
||||||
|
env:
|
||||||
|
TURBO_CACHE_DIR: .turbo
|
||||||
|
TURBO_TELEMETRY_DISABLED: 1
|
||||||
|
|
||||||
- name: Upload test coverage
|
- name: Upload test coverage
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|
|
@ -42,23 +42,9 @@ jobs:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
cache: 'pnpm'
|
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
|
- name: Install bun
|
||||||
run: npm install -g bun@1.2.15
|
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
|
- name: Mount Docker buildkit sticky disk
|
||||||
uses: useblacksmith/stickydisk@v1
|
uses: useblacksmith/stickydisk@v1
|
||||||
with:
|
with:
|
||||||
|
@ -68,17 +54,20 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
echo "📦 Installing dependencies with pnpm..."
|
echo "📦 Installing dependencies with pnpm..."
|
||||||
pnpm install --frozen-lockfile --prefer-offline
|
pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build with Turbo
|
- name: Build with Turbo
|
||||||
run: |
|
run: |
|
||||||
echo "🔨 Building server with Turbo (using sticky disk cache)..."
|
echo "🔨 Building server with Turbo..."
|
||||||
pnpm turbo run build --filter=@buster-app/server
|
# Build with optimized settings for Docker
|
||||||
|
pnpm turbo run build --filter=@buster-app/server...
|
||||||
echo "✅ Build complete!"
|
echo "✅ Build complete!"
|
||||||
env:
|
env:
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
DOCKER_BUILD: true
|
DOCKER_BUILD: true
|
||||||
CI: true
|
CI: true
|
||||||
|
TURBO_CACHE_DIR: .turbo
|
||||||
|
TURBO_TELEMETRY_DISABLED: 1
|
||||||
|
|
||||||
- name: Build server bundle
|
- name: Build server bundle
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -27,23 +27,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: 22
|
node-version: 22
|
||||||
cache: 'pnpm'
|
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
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile --prefer-offline
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: 🚀 Deploy to ${{ github.ref_name == 'main' && 'Production' || 'Staging' }}
|
- name: 🚀 Deploy to ${{ github.ref_name == 'main' && 'Production' || 'Staging' }}
|
||||||
env:
|
env:
|
||||||
|
|
Loading…
Reference in New Issue