action.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. name: Setup
  2. description: Setup Node.js and install dependencies
  3. runs:
  4. using: composite
  5. steps:
  6. - name: Setup Node.js
  7. uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
  8. with:
  9. node-version-file: .nvmrc
  10. - name: Restore dependencies
  11. id: yarn-cache
  12. uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
  13. with:
  14. path: |
  15. **/node_modules
  16. .yarn/install-state.gz
  17. key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
  18. restore-keys: |
  19. ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
  20. ${{ runner.os }}-yarn-
  21. - name: Install dependencies
  22. if: steps.yarn-cache.outputs.cache-hit != 'true'
  23. run: yarn install --immutable
  24. shell: bash
  25. - name: Cache dependencies
  26. if: steps.yarn-cache.outputs.cache-hit != 'true'
  27. uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
  28. with:
  29. path: |
  30. **/node_modules
  31. .yarn/install-state.gz
  32. key: ${{ steps.yarn-cache.outputs.cache-primary-key }}