tests: raise coverage from 62% to 93% via new test files (#1) #7
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] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - run: npm ci | |
| - name: Install coverage provider | |
| run: npm install --no-save @vitest/coverage-v8@^3.0.0 | |
| - name: Run tests | |
| run: npx vitest run --coverage | |
| continue-on-error: true | |
| - name: Coverage summary | |
| if: always() | |
| run: | | |
| if [ -d coverage ]; then | |
| ls coverage/ | |
| cat coverage/coverage-summary.json 2>/dev/null || true | |
| fi | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| if: always() | |
| with: | |
| directory: ./coverage | |
| flags: unittests | |
| name: sdk-node | |
| fail_ci_if_error: false | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: coverage-sdk-node | |
| path: coverage/ | |
| retention-days: 30 | |
| if-no-files-found: ignore |