companion.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. name: Companion
  2. on:
  3. push:
  4. branches: [ main ]
  5. paths:
  6. - yarn.lock
  7. - 'packages/@uppy/companion/**'
  8. - '.github/workflows/companion.yml'
  9. pull_request:
  10. # We want all branches so we configure types to be the GH default again
  11. types: [ opened, synchronize, reopened ]
  12. paths:
  13. - yarn.lock
  14. - 'packages/@uppy/companion/**'
  15. - '.github/workflows/companion.yml'
  16. jobs:
  17. test:
  18. name: Unit tests
  19. runs-on: ubuntu-latest
  20. strategy:
  21. matrix:
  22. node-version: [14.x, 16.x, 18.x]
  23. steps:
  24. - name: Checkout sources
  25. uses: actions/checkout@v3
  26. - name: Get yarn cache directory path
  27. id: yarn-cache-dir-path
  28. run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)"
  29. - uses: actions/cache@v3
  30. id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  31. with:
  32. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  33. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  34. restore-keys: |
  35. ${{ runner.os }}-yarn-
  36. - name: Install Node.js
  37. uses: actions/setup-node@v3
  38. with:
  39. node-version: ${{matrix.node-version}}
  40. - name: Install dependencies
  41. run: corepack yarn workspaces focus @uppy/companion
  42. - name: Run tests
  43. run: corepack yarn run test:companion