test: expand backend coverage to 93% and wire up Codecov #55
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: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [20, 22] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: npm | |
| cache-dependency-path: | | |
| package-lock.json | |
| webview-ui/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install webview dependencies | |
| run: cd webview-ui && npm ci | |
| - name: Type check (extension) | |
| run: npm run lint | |
| - name: Type check (webview) | |
| run: cd webview-ui && npm run check | |
| - name: Run tests with coverage | |
| run: npx vitest run --coverage | |
| - name: Upload coverage to Codecov | |
| if: matrix.node-version == 22 | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage/lcov.info | |
| fail_ci_if_error: false | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Build extension | |
| run: npm run build:extension | |
| - name: Build webview | |
| run: npm run build:webview |