1
Mistake 1 / 5
Not caching dependencies
`npm install` or `pip install` from scratch on every run. 300 packages, 45 seconds, every commit. Cache by lockfile hash and you pay that cost once per lockfile change.
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
✓ Cache by lockfile hash = near-zero re-install time