File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 update_cache :
2222 runs-on : ${{ inputs.cpu_architecture == 'x86_64' && 'ubuntu-latest' || format('ubuntu-latest-{0}', inputs.cpu_architecture) }}
2323 steps :
24+ - name : Deprecated warning
25+ run : echo "::warning::⚠️ deprecated workflow, use node-module-cache-v2.yml instead"
26+
2427 - uses : actions/checkout@v4
2528
2629 - name : Use Node.js version from package.json
Original file line number Diff line number Diff line change 1+ ---
2+ name : Update node_modules cache
3+
4+ on :
5+ workflow_call :
6+ inputs :
7+ use_legacy_peer_deps :
8+ type : boolean
9+ default : false
10+ description : Enable --legacy-peer-deps option
11+ use_ignore_scripts :
12+ type : boolean
13+ default : false
14+ description : Enable --ignore-scripts option
15+ cpu_architectures :
16+ type : string
17+ description : Array of architectures to run on (e.g., '["x86_64", "arm64"]')
18+
19+ jobs :
20+ update_cache :
21+ strategy :
22+ matrix :
23+ cpu_architecture : ${{ fromJSON(inputs.cpu_architectures) }}
24+
25+ runs-on : ${{ matrix.cpu_architecture == 'x86_64' && 'ubuntu-latest' || 'ubuntu-latest-arm64' }}
26+
27+ steps :
28+ - uses : actions/checkout@v4
29+
30+ - name : Use Node.js version from package.json
31+ uses : actions/setup-node@v4
32+ with :
33+ node-version-file : " package.json"
34+
35+ - name : Set authToken for npm
36+ run : |
37+ npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
38+
39+ - name : Npm install
40+ run : npm ci ${{ inputs.use_legacy_peer_deps && '--legacy-peer-deps' || ''}} ${{ inputs.use_ignore_scripts && '--ignore-scripts' || ''}}
41+
42+ - name : Save cache
43+ uses : actions/cache/save@v4
44+ with :
45+ path : " **/node_modules"
46+ key : ${{ runner.os }}-${{ runner.arch }}-npm-${{ hashFiles('package-lock.json') }}
You can’t perform that action at this time.
0 commit comments