companion.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. jobs:
  9. test:
  10. name: Unit tests
  11. runs-on: ubuntu-latest
  12. strategy:
  13. matrix:
  14. node-version: [14.x, 16.x, 18.x]
  15. steps:
  16. - name: Checkout sources
  17. uses: actions/checkout@v3
  18. - name: Get yarn cache directory path
  19. id: yarn-cache-dir-path
  20. run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)"
  21. - uses: actions/cache@v3
  22. id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  23. with:
  24. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  25. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  26. restore-keys: |
  27. ${{ runner.os }}-yarn-
  28. - name: Install Node.js
  29. uses: actions/setup-node@v3
  30. with:
  31. node-version: ${{matrix.node-version}}
  32. - name: Install dependencies
  33. run: corepack yarn workspaces focus @uppy/companion
  34. - name: Run tests
  35. run: corepack yarn run test:companion