Merge pull request #24 from junjie-w/develop #27
This file contains 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: Test and Lint | |
on: | |
pull_request: | |
branches: [main, develop] | |
push: | |
branches: [main] | |
jobs: | |
test-and-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.8.1 | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Run linting | |
run: npm run lint | |
- name: Run tests | |
run: npm run test:ci | |
- name: Upload coverage reports | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: | | |
coverage/ | |
!coverage/lcov-report/** | |
- name: Upload results to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage/lcov.info | |
fail_ci_if_error: true | |
verbose: true |