Skip to content

Commit d866b94

Browse files
committed
ci,ui: always install dependencies with pnpm
Previously, the 'cluster-ui-release' and 'cluster-ui-release-next' GitHub Actions workflows would fail when no new version needed to be published. When setup-node performs its post-run actions, it attempts to cache the global pnpm store. Unfortunately, that caching step fails when no global pnpm store exists, like during a cache-miss when `pnpm install` never ran. This caused the entire workflow to be marked as failed, adding needless noise to anyone who changed a file in `pkg/ui/workspaces/cluster-ui` without bumping the package version. Always run `pnpm install`, so that the global pnpm store is always populated and cacheable. Release note: None Epic: none
1 parent a14d6bb commit d866b94

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.github/workflows/cluster-ui-release-next.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ jobs:
4343
env:
4444
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4545

46+
# Always install node dependencies. It seems silly to do if we're not
47+
# going to actually use them, but setup-node's post-run action attempts
48+
# to save dependencies to a cache shared between GitHub actions. If the
49+
# pnpm store directory doesn't exist (e.g. during a cache miss), that
50+
# cache-saving step will fail and the entire job will be marked "failed"
51+
# as a result. Installing dependencies is the canonical way to seed the
52+
# pnpm store from-scratch.
53+
- name: Install dependencies
54+
run: pnpm install --frozen-lockfile
55+
4656
- name: Check if version is published
4757
id: version-check
4858
shell: bash
@@ -63,7 +73,6 @@ jobs:
6373
- name: Build Cluster UI
6474
if: steps.version-check.outputs.published == 'no'
6575
run: |
66-
pnpm install --frozen-lockfile
6776
bazel build //pkg/ui/workspaces/db-console/src/js:crdb-protobuf-client
6877
cp ../../../../_bazel/bin/pkg/ui/workspaces/db-console/src/js/protos.* ../db-console/src/js/
6978
pnpm build

.github/workflows/cluster-ui-release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ jobs:
4242
env:
4343
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4444

45+
# Always install node dependencies. It seems silly to do if we're not
46+
# going to actually use them, but setup-node's post-run action attempts
47+
# to save dependencies to a cache shared between GitHub actions. If the
48+
# pnpm store directory doesn't exist (e.g. during a cache miss), that
49+
# cache-saving step will fail and the entire job will be marked "failed"
50+
# as a result. Installing dependencies is the canonical way to seed the
51+
# pnpm store from-scratch.
52+
- name: Install dependencies
53+
run: pnpm install --frozen-lockfile
54+
4555
- name: Check if version is published
4656
id: version-check
4757
shell: bash
@@ -67,7 +77,6 @@ jobs:
6777
- name: Build Cluster UI
6878
if: steps.version-check.outputs.published == 'no'
6979
run: |
70-
pnpm install --frozen-lockfile
7180
bazel build //pkg/ui/workspaces/db-console/src/js:crdb-protobuf-client
7281
cp ../../../../_bazel/bin/pkg/ui/workspaces/db-console/src/js/protos.* ../db-console/src/js/
7382
pnpm build

0 commit comments

Comments
 (0)