Merge branch 'test/ci-workflow' - Phase 1 CI Workflow implementation #6
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: | |
| pull_request: | |
| branches: ['**'] | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: ESLint & Prettier | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18.x' | |
| cache: 'npm' | |
| - run: npm ci | |
| - run: npm run lint | |
| - run: npm run format:check | |
| test: | |
| name: Jest Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18.x' | |
| cache: 'npm' | |
| - run: npm ci | |
| - run: npm test -- --coverage | |
| - name: Upload coverage | |
| if: github.event_name == 'pull_request' | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| files: ./coverage/coverage-final.json | |
| flags: unittests | |
| build: | |
| name: Build Verification | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18.x' | |
| cache: 'npm' | |
| - run: npm ci | |
| - run: npm pack --dry-run | |
| audit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - run: npm ci | |
| - name: Run security audit | |
| run: npm audit --audit-level=moderate --production | |
| continue-on-error: false |