refactor: Move setup-claude-server.js to scripts/ directory #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main, develop ] | |
pull_request: | |
branches: [ main, develop ] | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
node-version: [18, 20] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install ripgrep | |
shell: bash | |
run: | | |
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then | |
sudo apt-get update && sudo apt-get install -y ripgrep | |
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then | |
brew install ripgrep | |
elif [[ "${{ matrix.os }}" == "windows-latest" ]]; then | |
choco install ripgrep | |
fi | |
- name: Install dependencies | |
env: | |
VSCODE_RIPGREP_SKIP_DOWNLOAD: 1 | |
run: | | |
# Skip binary download for @vscode/ripgrep and try install | |
npm ci || npm install --ignore-scripts | |
- name: Run linting (if available) | |
shell: bash | |
run: | | |
if npm run lint --if-present; then | |
echo "✅ Linting passed" | |
else | |
echo "ℹ️ No linting script found" | |
fi | |
- name: Run type checking | |
shell: bash | |
run: | | |
if npm run typecheck --if-present; then | |
echo "✅ Type checking passed" | |
else | |
echo "ℹ️ No typecheck script found, running tsc directly" | |
npx tsc --noEmit | |
fi | |
- name: Build project | |
run: npm run build | |
- name: Run tests | |
run: npm test | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: test-results-${{ matrix.os }}-node${{ matrix.node-version }} | |
path: | | |
test-results.xml | |
coverage/ | |
retention-days: 30 | |
build-check: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
- name: Install dependencies | |
env: | |
VSCODE_RIPGREP_SKIP_DOWNLOAD: 1 | |
run: | | |
# Skip binary download for @vscode/ripgrep and try install | |
npm ci || npm install --ignore-scripts | |
- name: Build and verify package | |
shell: bash | |
run: | | |
npm run build | |
# Get package size from npm pack output, handle errors gracefully | |
echo "📦 Checking package integrity and size..." | |
if PACK_OUTPUT=$(npm pack --dry-run 2>&1); then | |
echo "✅ Package integrity verified" | |
PACKAGE_SIZE=$(echo "$PACK_OUTPUT" | grep "package size:" | awk '{print $3" "$4}') | |
if [ -z "$PACKAGE_SIZE" ]; then | |
# Fallback: look for any size-related info | |
PACKAGE_SIZE=$(echo "$PACK_OUTPUT" | grep -E "(size|Size)" | tail -1 | awk '{print $(NF-1)" "$NF}') | |
fi | |
echo "📦 Package size: ${PACKAGE_SIZE:-"Unknown"}" | |
else | |
echo "⚠️ Package verification failed" | |
echo "Error output: $PACK_OUTPUT" | |
exit 1 | |
fi | |
- name: Verify binary executables | |
shell: bash | |
run: | | |
npm run build | |
if [ -f "dist/index.js" ]; then | |
echo "✅ Main executable found" | |
node dist/index.js --version || echo "ℹ️ Version check not available" | |
fi | |
if [ -f "dist/setup-claude-server.js" ]; then | |
echo "✅ Setup executable found" | |
fi |