Improve backup test reliability for CI #24
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 ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18.x, 20.x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| cache-dependency-path: claude-config-composer/package-lock.json | |
| - name: Install dependencies | |
| run: | | |
| cd claude-config-composer | |
| npm ci | |
| - name: Run tests | |
| run: | | |
| cd claude-config-composer | |
| npm test | |
| - name: Build package | |
| run: | | |
| cd claude-config-composer | |
| npm run build | |
| - name: Test CLI functionality | |
| run: | | |
| cd claude-config-composer | |
| node dist/cli.js --version | |
| node dist/cli.js list | |
| - name: Test config generation | |
| run: | | |
| cd /tmp | |
| node $GITHUB_WORKSPACE/claude-config-composer/dist/cli.js nextjs-15 shadcn | |
| test -d .claude | |
| test -f .claude/settings.json | |
| test -d .claude/agents | |
| test -d .claude/commands | |
| test -d .claude/hooks | |
| - name: Security audit | |
| run: | | |
| cd claude-config-composer | |
| npm audit --audit-level=high | |
| continue-on-error: true | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: claude-config-composer/package-lock.json | |
| - name: Install dependencies | |
| run: | | |
| cd claude-config-composer | |
| npm ci | |
| - name: TypeScript type checking | |
| run: | | |
| cd claude-config-composer | |
| npx tsc --noEmit | |
| - name: Check for TypeScript errors | |
| run: | | |
| cd claude-config-composer | |
| npm run build | |
| test-configs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: claude-config-composer/package-lock.json | |
| - name: Install and build | |
| run: | | |
| cd claude-config-composer | |
| npm ci | |
| npm run build | |
| - name: Test all individual configs | |
| run: | | |
| cd /tmp | |
| for config in nextjs-15 shadcn tailwindcss drizzle vercel-ai-sdk memory-mcp-server token-gated-mcp-server; do | |
| echo "Testing $config configuration..." | |
| rm -rf .claude | |
| node $GITHUB_WORKSPACE/claude-config-composer/dist/cli.js $config | |
| test -d .claude || exit 1 | |
| done | |
| - name: Test common combinations | |
| run: | | |
| cd /tmp | |
| echo "Testing Next.js + shadcn combination..." | |
| rm -rf .claude | |
| node $GITHUB_WORKSPACE/claude-config-composer/dist/cli.js nextjs-15 shadcn | |
| test -d .claude || exit 1 | |
| echo "Testing full-stack combination..." | |
| rm -rf .claude | |
| node $GITHUB_WORKSPACE/claude-config-composer/dist/cli.js nextjs-15 shadcn tailwindcss drizzle | |
| test -d .claude || exit 1 | |
| release-check: | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| needs: [test, lint, test-configs] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: claude-config-composer/package-lock.json | |
| - name: Check package version | |
| run: | | |
| cd claude-config-composer | |
| PACKAGE_VERSION=$(node -p "require('./package.json').version") | |
| echo "Package version: $PACKAGE_VERSION" | |
| echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV | |
| - name: Dry run npm publish | |
| run: | | |
| cd claude-config-composer | |
| npm ci | |
| npm run build | |
| npm pack --dry-run |