Skip to content

Commit 0b3a651

Browse files
committed
ci: Run pnpm from the project dir to fix corepack version detection
Set the working directory when running pnpm as corepack picks up the version from the `package.json` in the current directory. Otherwise, it might install the wrong version which then causes the version check of pnpm to fail. Signed-off-by: Martin Nonnenmacher <martin.nonnenmacher@doubleopen.io>
1 parent aa4055b commit 0b3a651

4 files changed

Lines changed: 35 additions & 18 deletions

File tree

.github/workflows/build-and-test.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,16 @@ jobs:
123123
run: corepack enable
124124

125125
- name: Install dependencies
126-
run: pnpm -C ui install
126+
working-directory: ui
127+
run: pnpm install
127128

128129
- name: Build UI
129-
run: pnpm -C ui build
130+
working-directory: ui
131+
run: pnpm build
130132

131133
- name: Test UI
132-
run: pnpm -C ui test
134+
working-directory: ui
135+
run: pnpm test
133136

134137
test:
135138
needs: build
@@ -247,13 +250,16 @@ jobs:
247250
run: corepack enable
248251

249252
- name: Install dependencies
250-
run: pnpm -C ui install
253+
working-directory: ui
254+
run: pnpm install
251255

252256
- name: Generate API client and routes
253-
run: pnpm -C ui generate:api && pnpm -C ui generate:routes
257+
working-directory: ui
258+
run: pnpm generate:api && pnpm generate:routes
254259

255260
- name: Install Playwright Browsers
256-
run: pnpm -C ui exec playwright install --with-deps
261+
working-directory: ui
262+
run: pnpm exec playwright install --with-deps
257263

258264
- name: Start core services
259265
run: docker compose up -d core
@@ -280,13 +286,14 @@ jobs:
280286
env:
281287
VITE_UI_URL: http://127.0.0.1:8082/
282288
VITE_CLIENT_ID: ort-server-ui
289+
working-directory: ui
283290
run: |
284291
# Exit on error, undefined variables, and pipe failures
285292
set -euo pipefail
286293
287294
# Start the Vite dev server in the background
288295
# The dev server is needed because Playwright tests run against a live server
289-
pnpm -C ui dev --host 0.0.0.0 --port 8082 > ui-dev.log 2>&1 &
296+
pnpm dev --host 0.0.0.0 --port 8082 > ui-dev.log 2>&1 &
290297
UI_DEV_PID=$!
291298
292299
# Set up cleanup to ensure the background dev server process is killed on exit
@@ -325,7 +332,7 @@ jobs:
325332
sleep 2
326333
done
327334
328-
pnpm -C ui test:e2e
335+
pnpm test:e2e
329336
330337
- name: Upload UI dev log
331338
if: success() || failure()

.github/workflows/publish-website.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ jobs:
3333
run: corepack enable
3434

3535
- name: Install dependencies
36-
run: pnpm -C website install --frozen-lockfile
36+
working-directory: website
37+
run: pnpm install --frozen-lockfile
3738

3839
- name: Test build
39-
run: pnpm -C website build
40+
working-directory: website
41+
run: pnpm build
4042

4143
- name: Setup Pages
4244
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0

.github/workflows/static-analysis.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,12 @@ jobs:
7979
run: corepack enable
8080

8181
- name: Install dependencies
82-
run: pnpm -C ui install --dev
82+
working-directory: ui
83+
run: pnpm install --dev
8384

8485
- name: Run ESLint
85-
run: pnpm -C ui lint
86+
working-directory: ui
87+
run: pnpm lint
8688

8789
prettier-ui:
8890
runs-on: ubuntu-24.04
@@ -100,10 +102,12 @@ jobs:
100102
run: corepack enable
101103

102104
- name: Install dependencies
103-
run: pnpm -C ui install --dev
105+
working-directory: ui
106+
run: pnpm install --dev
104107

105108
- name: Run Prettier
106-
run: pnpm -C ui format:check
109+
working-directory: ui
110+
run: pnpm format:check
107111

108112
prettier-website:
109113
runs-on: ubuntu-24.04
@@ -121,10 +125,12 @@ jobs:
121125
run: corepack enable
122126

123127
- name: Install dependencies
124-
run: pnpm -C website install --dev
128+
working-directory: website
129+
run: pnpm install --dev
125130

126131
- name: Run Prettier
127-
run: pnpm -C website format:check
132+
working-directory: website
133+
run: pnpm format:check
128134

129135
renovate-validation:
130136
runs-on: ubuntu-24.04

.github/workflows/website-test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ jobs:
3030
run: corepack enable
3131

3232
- name: Install dependencies
33-
run: pnpm -C website install --frozen-lockfile
33+
working-directory: website
34+
run: pnpm install --frozen-lockfile
3435

3536
- name: Test build
36-
run: pnpm -C website build
37+
working-directory: website
38+
run: pnpm build

0 commit comments

Comments
 (0)