Skip to content

Commit

Permalink
Cache nvm install in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Oct 16, 2024
1 parent 1546297 commit 5a58284
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,21 @@ commands:
command: |
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
- restore_cache:
name: Restore nvm cache
key: v1-nvm-cache-<< parameters.node >>
- run:
name: Switch node versions
command: |
nvm install << parameters.node >>
nvm alias default << parameters.node >>
NODE_DIR=$(dirname $(which node))
echo "export PATH=$NODE_DIR:\$PATH" >> $BASH_ENV
- save_cache:
name: Save nvm cache
key: v1-nvm-cache-<< parameters.node >>
paths:
- /opt/circleci/.nvm/.cache
- run:
name: Check node versions
command: |
Expand Down

0 comments on commit 5a58284

Please sign in to comment.