companion.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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: [10.20.1, 12.x, 14.x, 16.x, 17.x]
  15. steps:
  16. - name: Checkout sources
  17. uses: actions/checkout@v3
  18. - name: Install Corepack if needed
  19. run: corepack -v || npm install -g corepack
  20. - name: Get yarn cache directory path
  21. id: yarn-cache-dir-path
  22. run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)"
  23. - uses: actions/cache@v3
  24. id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  25. with:
  26. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  27. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  28. restore-keys: |
  29. ${{ runner.os }}-yarn-
  30. - name: Install Node.js
  31. uses: actions/setup-node@v3
  32. with:
  33. node-version: ${{matrix.node-version}}
  34. - name: Install dependencies
  35. run: corepack yarn install --immutable
  36. env:
  37. # Necessary for Node.js v10.x
  38. NODE_OPTIONS: --experimental-worker
  39. YARN_IGNORE_NODE: 1
  40. - name: Run tests
  41. run: corepack yarn run test:companion
  42. env:
  43. # Necessary for Node.js v10.x
  44. NODE_OPTIONS: --experimental-worker
  45. YARN_IGNORE_NODE: 1