diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index b9157a2..669f30e 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -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