ci.yml 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. name: CI
  2. on:
  3. push:
  4. branches: [ master, main ]
  5. pull_request:
  6. branches: [ master, main ]
  7. jobs:
  8. lint-and-test:
  9. runs-on: ubuntu-latest
  10. strategy:
  11. matrix:
  12. node-version: [18.x, 20.x, 22.x]
  13. steps:
  14. - uses: actions/checkout@v4
  15. - name: Use Node.js ${{ matrix.node-version }}
  16. uses: actions/setup-node@v4
  17. with:
  18. node-version: ${{ matrix.node-version }}
  19. cache: 'npm'
  20. - name: Install dependencies
  21. run: npm ci
  22. - name: Run linter
  23. run: npm run lint
  24. - name: Run tests
  25. run: npm test
  26. - name: Upload coverage reports
  27. uses: codecov/codecov-action@v4
  28. if: matrix.node-version == '20.x'
  29. with:
  30. file: ./coverage/lcov.info
  31. flags: unittests
  32. name: codecov-umbrella
  33. fail_ci_if_error: false
  34. - name: Build
  35. run: npm run build
  36. - name: Test built executable
  37. run: |
  38. chmod +x build/index.js
  39. node build/index.js --version || true