Skip to content

Commit 3c133ce

Browse files
fix: use absolute path for TSX_TSCONFIG_PATH in CI workflows
E2E tests create temporary directories (e.g. tmp/e2e/plugin-eslint-e2e/) and tsx was trying to resolve the relative path from the current working directory instead of the workspace root, causing: Error: Cannot resolve tsconfig at path: /home/runner/work/cli/cli/tmp/e2e/plugin-eslint-e2e/tsconfig.base.json Solution: Use absolute path ${{ github.workspace }}/tsconfig.base.json in all workflow steps that set TSX_TSCONFIG_PATH. Local .env.local can still use relative path since development happens from the workspace root. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 5fee579 commit 3c133ce

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Check formatting of affected files
3232
env:
3333
NODE_OPTIONS: --import tsx
34-
TSX_TSCONFIG_PATH: tsconfig.base.json
34+
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
3535
run: npx nx format:check
3636

3737
lint:
@@ -54,7 +54,7 @@ jobs:
5454
- name: Lint affected projects
5555
env:
5656
NODE_OPTIONS: --import tsx
57-
TSX_TSCONFIG_PATH: tsconfig.base.json
57+
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
5858
run: npx nx affected -t lint --parallel=3
5959

6060
unit-test:
@@ -81,7 +81,7 @@ jobs:
8181
- name: Unit test affected projects
8282
env:
8383
NODE_OPTIONS: --import tsx
84-
TSX_TSCONFIG_PATH: tsconfig.base.json
84+
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
8585
run: npx nx affected -t unit-test --parallel=3
8686

8787
integration-test:
@@ -108,7 +108,7 @@ jobs:
108108
- name: Integration test affected projects
109109
env:
110110
NODE_OPTIONS: --import tsx
111-
TSX_TSCONFIG_PATH: tsconfig.base.json
111+
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
112112
run: npx nx affected -t int-test --parallel=3
113113

114114
e2e:
@@ -135,7 +135,7 @@ jobs:
135135
- name: E2E test affected projects
136136
env:
137137
NODE_OPTIONS: --import tsx
138-
TSX_TSCONFIG_PATH: tsconfig.base.json
138+
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
139139
run: npx nx affected -t e2e-test --parallel=1
140140

141141
build:
@@ -158,7 +158,7 @@ jobs:
158158
- name: Build all projects # affected is not used to be able to test-releae packages
159159
env:
160160
NODE_OPTIONS: --import tsx
161-
TSX_TSCONFIG_PATH: tsconfig.base.json
161+
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
162162
run: npx nx run-many --target=build --parallel=3
163163
- name: Test-release packages
164164
run: npx pkg-pr-new publish "packages/**/dist"

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
id: list-packages
2727
env:
2828
NODE_OPTIONS: --import tsx
29-
TSX_TSCONFIG_PATH: tsconfig.base.json
29+
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
3030
run: |
3131
matrix=$(node tools/scripts/create-codecov-matrix.js)
3232
echo "matrix=$matrix" >> $GITHUB_OUTPUT
@@ -53,7 +53,7 @@ jobs:
5353
- name: Execute tests with coverage
5454
env:
5555
NODE_OPTIONS: --import tsx
56-
TSX_TSCONFIG_PATH: tsconfig.base.json
56+
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
5757
run: npx nx run ${{ matrix.project }}:${{ matrix.target }}
5858
- name: Upload coverage reports to Codecov
5959
uses: codecov/codecov-action@v4

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ jobs:
4444
- name: Publish packages to npm
4545
env:
4646
NODE_OPTIONS: --import tsx
47-
TSX_TSCONFIG_PATH: tsconfig.base.json
47+
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
4848
run: npx nx release publish

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ jobs:
4848
- name: Version, release and generate changelog
4949
env:
5050
NODE_OPTIONS: --import tsx
51-
TSX_TSCONFIG_PATH: tsconfig.base.json
51+
TSX_TSCONFIG_PATH: ${{ github.workspace }}/tsconfig.base.json
5252
GH_TOKEN: ${{ steps.app-token.outputs.token }}
5353
run: npx nx release --skip-publish

0 commit comments

Comments
 (0)