js.yml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: JS Tests
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request:
  7. workflow_dispatch:
  8. env:
  9. FORCE_COLOR: 2
  10. NODE: 20
  11. permissions:
  12. contents: read
  13. jobs:
  14. run:
  15. permissions:
  16. # allow coverallsapp/github-action to create new checks issues and fetch code
  17. checks: write
  18. contents: read
  19. name: JS Tests
  20. runs-on: ubuntu-latest
  21. steps:
  22. - name: Clone repository
  23. uses: actions/checkout@v4
  24. with:
  25. persist-credentials: false
  26. - name: Set up Node.js
  27. uses: actions/setup-node@v4
  28. with:
  29. node-version: ${{ env.NODE }}
  30. cache: npm
  31. - name: Install npm dependencies
  32. run: npm ci
  33. - name: Run dist
  34. run: npm run js
  35. - name: Run JS tests
  36. run: npm run js-test
  37. - name: Run Coveralls
  38. uses: coverallsapp/github-action@v2
  39. if: ${{ !github.event.repository.fork }}
  40. with:
  41. github-token: "${{ secrets.GITHUB_TOKEN }}"
  42. path-to-lcov: "./js/coverage/lcov.info"