Skip to content

Commit

Permalink
fix(github-actions): npm global cache
Browse files Browse the repository at this point in the history
  • Loading branch information
mildronize committed May 17, 2024
1 parent beb3602 commit b0bc1d5
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,26 @@ jobs:
run: pnpm install

- uses: actions/cache@v4
name: Setup npm global cache
name: Cache global npm packages
with:
path: ~/.npm
key: ${{ runner.os }}-build-azure-functions-core-tools-v4
# a ternary operator
# Ref: https://docs.github.com/en/actions/learn-github-actions/expressions#example
path: ${{ runner.os == 'Windows' && '~/AppData/Roaming/npm-cache' || '~/.npm' }}
key: ${{ runner.os }}-node-global-npm
restore-keys: |
${{ runner.os }}-node-global-npm
- name: Install Azure Functions Core Tools
run: npm i -g azure-functions-core-tools@4 --unsafe-perm true

- name: Cache global node_modules
uses: actions/cache@v4
with:
path: ${{ runner.os == 'Windows' && '~/AppData/Roaming/npm/node_modules' || '/usr/local/lib/node_modules' }}
key: ${{ runner.os }}-node-${{ github.sha }}-global-modules
restore-keys: |
${{ runner.os }}-node-global-modules
- name: Azure Functions Version
run: func --version

Expand Down

0 comments on commit b0bc1d5

Please sign in to comment.