Add full test coverage for ProductCatalogService & ESLint CI enforcement #33
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: frontend-services-ci | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| paths: | |
| - '.github/workflows/frontend.yaml' | |
| - 'src/frontend/**' | |
| pull_request_target: | |
| branches: [main] | |
| paths: | |
| - '.github/workflows/frontend.yaml' | |
| - 'src/frontend/**' | |
| jobs: | |
| unit-testing: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install dependencies | |
| run: | | |
| cd src/frontend | |
| npm install | |
| - name: Run unit tests | |
| run: | | |
| cd src/frontend | |
| npm test -- --coverage --watchAll=false | |
| code-quality: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install dependencies | |
| run: | | |
| cd src/frontend | |
| npm install | |
| - name: Run ESLint (code quality check) | |
| run: | | |
| cd src/frontend | |
| npm run lint -- --max-warnings=0 --quiet |