ci.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. name: ci
  2. on: [push, pull_request]
  3. jobs:
  4. should-skip:
  5. continue-on-error: true
  6. runs-on: ubuntu-latest
  7. # Map a step output to a job output
  8. outputs:
  9. should-skip-job: ${{steps.skip-check.outputs.should_skip}}
  10. steps:
  11. - id: skip-check
  12. uses: fkirc/skip-duplicate-actions@v2.1.0
  13. with:
  14. github_token: ${{github.token}}
  15. ci:
  16. needs: should-skip
  17. if: ${{needs.should-skip.outputs.should-skip-job != 'true' || github.ref == 'refs/heads/main'}}
  18. strategy:
  19. fail-fast: false
  20. matrix:
  21. os: [ubuntu-latest]
  22. env:
  23. BROWSER_STACK_USERNAME: ${{secrets.BROWSER_STACK_USERNAME}}
  24. BROWSER_STACK_ACCESS_KEY: ${{secrets.BROWSER_STACK_ACCESS_KEY}}
  25. runs-on: ${{matrix.os}}
  26. steps:
  27. - name: checkout code
  28. uses: actions/checkout@v2
  29. - name: read node version from .nvmrc
  30. run: echo ::set-output name=NVMRC::$(cat .nvmrc)
  31. shell: bash
  32. id: nvm
  33. - name: update apt cache on linux w/o browserstack
  34. run: sudo apt-get update
  35. - name: install ffmpeg/pulseaudio for firefox on linux w/o browserstack
  36. run: sudo apt-get install ffmpeg pulseaudio
  37. - name: start pulseaudio for firefox on linux w/o browserstack
  38. run: pulseaudio -D
  39. - name: setup node
  40. uses: actions/setup-node@v2
  41. with:
  42. node-version: '${{steps.nvm.outputs.NVMRC}}'
  43. cache: npm
  44. # turn off the default setup-node problem watchers...
  45. - run: echo "::remove-matcher owner=eslint-compact::"
  46. - run: echo "::remove-matcher owner=eslint-stylish::"
  47. - run: echo "::remove-matcher owner=tsc::"
  48. - name: npm install
  49. run: npm i --prefer-offline --no-audit
  50. - name: run npm test
  51. uses: GabrielBB/xvfb-action@v1
  52. with:
  53. run: npm run test