diff --git a/.github/workflows/cross-language-integration.yml b/.github/workflows/cross-language-integration.yml index 9ba2a2d7b..495692e77 100644 --- a/.github/workflows/cross-language-integration.yml +++ b/.github/workflows/cross-language-integration.yml @@ -22,6 +22,14 @@ jobs: with: go-version: '1.25' + - name: Cache npm downloads + uses: actions/cache@v6 + with: + path: ~/.npm + key: npm-cross-language-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + restore-keys: | + npm-cross-language-${{ runner.os }}- + - name: Install dependencies run: npm install diff --git a/.github/workflows/validation.yaml b/.github/workflows/validation.yaml index 7bb00098e..3c635dc0f 100644 --- a/.github/workflows/validation.yaml +++ b/.github/workflows/validation.yaml @@ -28,6 +28,20 @@ jobs: with: python-version: '3.11' + - name: Resolve npm cache directory + id: npm-cache-dir + shell: bash + # tr strips the carriage return npm emits on the Windows runner. + run: echo "dir=$(npm config get cache | tr -d '\r')" >> "$GITHUB_OUTPUT" + + - name: Cache npm downloads + uses: actions/cache@v6 + with: + path: ${{ steps.npm-cache-dir.outputs.dir }} + key: npm-validation-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + restore-keys: | + npm-validation-${{ runner.os }}- + - name: Install dependencies run: npm install