companion.yml 1.2 KB

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