Merge pull request #65 from CEIT-SSC/review #259
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: | |
| pull_request: | |
| branches: [main, develop] | |
| push: | |
| branches: [main, develop] | |
| jobs: | |
| lint-and-typecheck: | |
| name: Lint and Type Check | |
| runs-on: ubuntu-latest | |
| env: | |
| TURBO_TELEMETRY_DISABLED: 1 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Enable corepack and activate pnpm | |
| run: | | |
| corepack enable | |
| corepack prepare pnpm@9.0.0 --activate | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Get changed files | |
| id: changed-files | |
| uses: tj-actions/changed-files@v44 | |
| with: | |
| files: | | |
| **/*.{ts,tsx,js,jsx} | |
| !**/node_modules/** | |
| !**/.next/** | |
| !**/dist/** | |
| - name: Run ESLint on changed files | |
| if: steps.changed-files.outputs.any_changed == 'true' | |
| run: | | |
| echo "Changed files: ${{ steps.changed-files.outputs.all_changed_files }}" | |
| pnpm turbo lint | |
| - name: Run TypeScript type check | |
| run: pnpm turbo type-check | |
| - name: Run full lint if no changed files detected | |
| if: steps.changed-files.outputs.any_changed == 'false' | |
| run: pnpm turbo lint |