Skip to content

Commit d187c4f

Browse files
committed
Update CI jobs to correctly use npm cache
Also remove `setup-node` usage from the build test job as it only needs go.
1 parent 2ecef9a commit d187c4f

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,6 @@ jobs:
4242
cache-dependency-path: "${{ github.workspace }}/src/github.com/tektoncd/dashboard/go.sum"
4343
go-version-file: "${{ github.workspace }}/src/github.com/tektoncd/dashboard/go.mod"
4444

45-
- name: Set up Node.js
46-
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
47-
with:
48-
cache: npm
49-
cache-dependency-path: src/github.com/tektoncd/dashboard/package-lock.json
50-
node-version-file: src/github.com/tektoncd/dashboard/.nvmrc
51-
registry-url: 'https://registry.npmjs.org/'
52-
5345
- name: Install dependencies
5446
run: |
5547
echo "${GOPATH}/bin" >> "$GITHUB_PATH"
@@ -80,7 +72,7 @@ jobs:
8072
- name: Set up Node.js
8173
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
8274
with:
83-
cache: npm
75+
# cache: npm
8476
node-version-file: .nvmrc
8577
registry-url: 'https://registry.npmjs.org/'
8678

test/presubmit-tests.sh

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,27 @@ function get_node() {
8383
function node_npm_install() {
8484
local failed=0
8585
get_node
86-
echo "Configuring npm"
87-
mkdir ~/.npm-global
88-
npm config set prefix '~/.npm-global'
89-
export PATH=$PATH:$HOME/.npm-global/bin
86+
# echo "Configuring npm"
87+
# set -x
88+
# mkdir ~/.npm-global
89+
# echo "Get npm cache location"
90+
# npm config get cache
91+
# echo "Set npm prefix"
92+
# npm config set prefix '~/.npm-global'
93+
# echo "Get npm cache location"
94+
# npm config get cache
95+
# export PATH=$PATH:$HOME/.npm-global/bin
96+
# set +x
9097
echo "Installing package dependencies"
9198
npm ci || failed=1 # similar to `npm install` but ensures all versions from lock file
99+
echo "Checking cache"
100+
set -x
101+
NPM_CACHE_DIR=$(npm config get cache)
102+
echo $NPM_CACHE_DIR
103+
ls $NPM_CACHE_DIR
104+
du -sh $NPM_CACHE_DIR
105+
npm config get prefix
106+
set +x
92107
return ${failed}
93108
}
94109

0 commit comments

Comments
 (0)