npm-install
npm-install copied to clipboard
Trying to interpret results
Thanks for this GitHub action @bahmutov.
I just gave it a shot and I'm trying to interp the lackluster results. Maybe I'm doing something wrong.
PR here https://github.com/graphql-nexus/nexus/pull/1120
commit 1 windows - 2:31 commit 2 windows - 2:32 (cache MISS)
commit 1 linx - 0:30 commit 2 linux - 0:28 (cache HIT)
Things I'm trying to understand are:
- Why cache miss on windows?
- Why such paltry improvement on linux despite cache hit?
I'm also only seeing an improvement from about 1:50 -> 1:30 when using this versus just using yarn install
by itself.
I'm seeing that the cache is being hit on subsequent re-runs of the job, but why is it still taking such a long time? I figured it would be nearly instant with a perfect cache hit.
running npm-install GitHub Action
trying to restore cached NPM modules
Received 213909504 of 365965720 (58.5%), 203.8 MBs/sec
Received 365965720 of 365965720 (100.0%), 189.8 MBs/sec
Cache Size: ~349 MB (365965720 B)
/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/<REDACTED>/cache.tzst -P -C /home/runner/work/<REDACTED>
npm cache hit yarn-linux-x64-3a2364d40e715bf57f5a89cd2e3a5ae36198ebed7deb8c44928ec3f703f1dcca8c599033ea8a6462f86a79766ad6412cadfbd99b53bd56ac17b2fd9d491d21f9
installing NPM dependencies using Yarn
yarn at "/usr/bin/yarn"
/usr/bin/yarn --frozen-lockfile
warning " > [email protected]" has incorrect peer dependency "react-native@^0.51.0".
warning " > [email protected]" has incorrect peer dependency "[email protected]".
warning " > [email protected]" has unmet peer dependency "create-react-class@^15.6.2".
warning " > [email protected]" has incorrect peer dependency "react@^16.8.4".
warning " > [email protected]" has incorrect peer dependency "react-native@^0.58.6".
warning " > [email protected]" has incorrect peer dependency "[email protected] || 0.14.x || ^15.0.0-0 || 15.x".
warning " > [email protected]" has incorrect peer dependency "eslint@^3.0.0 || ^4.0.0".
all done, exiting
Hello, same situation here o/
I tried this github action but it's slower than using the default actions/cache@v2 :
# cache hit = 1m12s
- uses: bahmutov/npm-install@v1
with:
install-command: yarn --frozen-lockfile --prefer-offline
# cache hit = 53s
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Save the yarn cache directory
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile --prefer-offline