diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b94286a8..be9d3243 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,4 @@ name: CI -permissions: - contents: read permissions: contents: read @@ -13,53 +11,66 @@ on: jobs: lint: - name: Lint + name: Lint & Style Check runs-on: ubuntu-latest steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions/setup-node@v4 + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Set up Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: '20' - cache: 'npm' - - run: npm ci - - run: npm run lint - - - name: Super-Linter - - uses: super-linter/super-linter@v8.6.0 - + cache: npm + - name: Install dependencies + run: npm ci + - name: Run ESLint + run: npm run lint + typecheck: - name: TypeScript Check + name: TypeScript Type Check runs-on: ubuntu-latest steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions/setup-node@v4 + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Set up Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: '20' - cache: 'npm' - - run: npm ci - - run: npx tsc --noEmit + cache: npm + - name: Install dependencies + run: npm ci + - name: Run TypeScript compiler + run: npm run typecheck test: - name: Tests + name: Unit Tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions/setup-node@v4 + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Set up Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: '20' - cache: 'npm' - - run: npm ci - - run: npm run test:run + cache: npm + - name: Install dependencies + run: npm ci + - name: Run test suite + run: npm run test:run build: - name: Build + name: Production Build runs-on: ubuntu-latest needs: [lint, typecheck, test] steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions/setup-node@v4 + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Set up Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 with: node-version: '20' - cache: 'npm' - - run: npm ci - - run: npm run build + cache: npm + - name: Install dependencies + run: npm ci + - name: Build project + run: npm run build diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index d1e83ae9..95343aaa 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -163,6 +163,17 @@ All tests should pass. git push origin feature/your-feature-name ``` +### CI Jobs (GitHub Actions) + +The `.github/workflows/ci.yml` workflow runs four focused jobs on pushes and pull requests to `main`: + +- **Lint & Style Check**: Runs `npm run lint` to enforce ESLint and style rules. +- **TypeScript Type Check**: Runs `npm run typecheck` to catch type errors without building. +- **Unit Tests**: Runs `npm run test:run` to execute the Vitest suite in CI mode. +- **Production Build**: Runs `npm run build` after lint, typecheck, and tests pass to verify production build integrity. + +This split makes failures easier to diagnose and keeps merge checks explicit. + ## Project Structure Understanding the project layout is crucial for effective development. @@ -648,7 +659,7 @@ npm install ```bash # Check TypeScript compilation -npx tsc --noEmit +npm run typecheck # Restart TypeScript server in VS Code Cmd/Ctrl + Shift + P → "TypeScript: Restart TS Server" @@ -681,7 +692,7 @@ npm run test -- --reporter=verbose ```bash # Check for TypeScript errors first -npx tsc --noEmit +npm run typecheck # Check for linting errors npm run lint