companion.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. env:
  17. YARN_ENABLE_GLOBAL_CACHE: false
  18. jobs:
  19. test:
  20. name: Unit tests
  21. runs-on: ubuntu-latest
  22. strategy:
  23. matrix:
  24. node-version: [14.x, 16.x, 18.x]
  25. steps:
  26. - name: Checkout sources
  27. uses: actions/checkout@v3
  28. - name: Get yarn cache directory path
  29. id: yarn-cache-dir-path
  30. run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
  31. - uses: actions/cache@v3
  32. id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  33. with:
  34. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  35. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  36. restore-keys: |
  37. ${{ runner.os }}-yarn-
  38. - name: Install Node.js
  39. uses: actions/setup-node@v3
  40. with:
  41. node-version: ${{matrix.node-version}}
  42. - name: Install dependencies
  43. run: corepack yarn workspaces focus @uppy/companion
  44. - name: Run tests
  45. run: corepack yarn run test:companion
  46. - name: Run type checks in focused workspace
  47. run: corepack yarn run build:companion