fix: update footer pricing link to point to /subscription #40
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/CD Pipeline | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| permissions: | |
| contents: write | |
| checks: write | |
| pull-requests: write | |
| jobs: | |
| # ────────────────────────────────────────────────────────────── | |
| # Type checking with strict mode | |
| # ────────────────────────────────────────────────────────────── | |
| typecheck: | |
| name: Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run TypeScript compiler | |
| run: npm run typecheck | |
| # ────────────────────────────────────────────────────────────── | |
| # Unit & Integration Tests with Coverage | |
| # ────────────────────────────────────────────────────────────── | |
| test: | |
| name: Test Suite (Node ${{ matrix.node-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: ['20', '22'] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout | |
| 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: Install dependencies | |
| run: npm ci | |
| - name: Run tests with coverage | |
| run: npm run test:ci | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| if: matrix.node-version == '20' | |
| with: | |
| fail_ci_if_error: false | |
| # ────────────────────────────────────────────────────────────── | |
| # Build Verification | |
| # ────────────────────────────────────────────────────────────── | |
| build: | |
| name: Build & Verify | |
| runs-on: ubuntu-latest | |
| needs: [typecheck, test] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build project | |
| run: npm run build | |
| - name: Verify dist output | |
| run: | | |
| test -f dist/index.js || (echo "❌ Build failed: dist/index.js not found" && exit 1) | |
| file dist/index.js | grep -q "JavaScript" || echo "⚠️ dist/index.js type check skipped" | |
| test -d dist/core || (echo "❌ Build failed: core modules missing" && exit 1) | |
| echo "✅ Build verification passed" | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-dist | |
| path: dist/ | |
| retention-days: 5 | |
| # ────────────────────────────────────────────────────────────── | |
| # Security: Dependency Scanning | |
| # ────────────────────────────────────────────────────────────── | |
| security: | |
| name: Security Scan | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Audit npm packages | |
| run: npm audit --audit-level=high | |
| continue-on-error: true | |
| - name: Check for known vulnerabilities | |
| run: | | |
| npm audit --json > audit-report.json || true | |
| if grep -q '"vulnerable"' audit-report.json; then | |
| echo "⚠️ Vulnerabilities found - review audit-report.json" | |
| else | |
| echo "✅ No known vulnerabilities" | |
| fi | |
| # ────────────────────────────────────────────────────────────── | |
| # Quality Gates: Run on changed files | |
| # ────────────────────────────────────────────────────────────── | |
| quality-gates: | |
| name: Quality Gates | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| - name: Run GitPulse quality gates | |
| run: npm run test -- src/core/__tests__/quality-gates.test.ts | |
| # ────────────────────────────────────────────────────────────── | |
| # Final Status Check | |
| # ────────────────────────────────────────────────────────────── | |
| status-check: | |
| name: CI Status | |
| runs-on: ubuntu-latest | |
| needs: [typecheck, test, build, security, quality-gates] | |
| if: always() | |
| steps: | |
| - name: Check critical job status | |
| run: | | |
| TYPECHECK_STATUS="${{ needs.typecheck.result }}" | |
| TEST_STATUS="${{ needs.test.result }}" | |
| BUILD_STATUS="${{ needs.build.result }}" | |
| if [[ "$TYPECHECK_STATUS" == "failure" ]]; then | |
| echo "❌ Type checking failed" | |
| exit 1 | |
| fi | |
| if [[ "$TEST_STATUS" == "failure" ]]; then | |
| echo "❌ Tests failed" | |
| exit 1 | |
| fi | |
| if [[ "$BUILD_STATUS" == "failure" ]]; then | |
| echo "❌ Build failed" | |
| exit 1 | |
| fi | |
| echo "✅ All CI checks passed!" | |
| # ────────────────────────────────────────────────────────────── | |
| # Release: Tag and create GitHub Release (main only) | |
| # ────────────────────────────────────────────────────────────── | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| needs: status-check | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' && startsWith(github.event.head_commit.message, 'chore(release):') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build for release | |
| run: npm run build | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: dist/**/* | |
| generate_release_notes: true | |
| token: ${{ secrets.GITHUB_TOKEN }} |