Skip to content

Commit c9f1309

Browse files
committed
chore(ci): completely separate postgrest tests
1 parent fe2156b commit c9f1309

File tree

3 files changed

+44
-17
lines changed

3 files changed

+44
-17
lines changed

.github/workflows/ci-core.yml

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ jobs:
5757
run: npx nx affected --target=test:ci
5858
timeout-minutes: 15
5959

60-
- name: Run type tests for affected packages (parallel)
61-
run: npx nx affected --target=test:types:ci
62-
timeout-minutes: 15
63-
6460
- name: Upload coverage for functions-js (if affected)
6561
uses: coverallsapp/github-action@v2
6662
with:
@@ -80,15 +76,6 @@ jobs:
8076
flag-name: realtime-js
8177
fail-on-error: false
8278
continue-on-error: true
83-
- name: Upload coverage for postgrest-js (if affected)
84-
uses: coverallsapp/github-action@v2
85-
with:
86-
github-token: ${{ secrets.GITHUB_TOKEN }}
87-
path-to-lcov: ./packages/core/postgrest-js/coverage/lcov.info
88-
parallel: true
89-
flag-name: postgrest-js
90-
fail-on-error: false
91-
continue-on-error: true
9279
- name: Run auth-js tests (if affected)
9380
run: npx nx affected --target=test:auth
9481

@@ -113,6 +100,41 @@ jobs:
113100
flag-name: storage-js
114101
fail-on-error: false
115102
continue-on-error: true
103+
# Separate job for postgrest-js tests (Docker-based, retriable)
104+
test-postgrest-js:
105+
name: Test postgrest-js
106+
runs-on: ubuntu-latest
107+
steps:
108+
- uses: actions/checkout@v4
109+
with:
110+
filter: tree:0
111+
fetch-depth: 0
112+
- uses: actions/setup-node@v4
113+
with:
114+
node-version: 20
115+
cache: 'npm'
116+
- name: Install dependencies
117+
run: npm ci --legacy-peer-deps
118+
- uses: nrwl/nx-set-shas@v4
119+
120+
- name: Run postgrest-js integration tests (if affected)
121+
run: npx nx affected --target=test:ci:postgrest
122+
timeout-minutes: 10
123+
124+
- name: Run postgrest-js type tests (if affected)
125+
run: npx nx affected --target=test:types:ci
126+
timeout-minutes: 15
127+
128+
- name: Upload coverage for postgrest-js (if affected)
129+
uses: coverallsapp/github-action@v2
130+
with:
131+
github-token: ${{ secrets.GITHUB_TOKEN }}
132+
path-to-lcov: ./packages/core/postgrest-js/coverage/lcov.info
133+
parallel: true
134+
flag-name: postgrest-js
135+
fail-on-error: false
136+
continue-on-error: true
137+
116138
# Separate job for slow type generation check (runs in parallel)
117139
check-postgrest-generated-types:
118140
name: Check Postgrest Generated Types
@@ -152,15 +174,15 @@ jobs:
152174
all-core-tests-pass:
153175
name: All Core Package Tests Pass
154176
runs-on: ubuntu-latest
155-
needs: [setup-build-test-node-20, check-postgrest-generated-types]
177+
needs: [setup-build-test-node-20, test-postgrest-js, check-postgrest-generated-types]
156178
steps:
157179
- name: Summary
158180
run: echo "✅ All core package tests passed successfully!"
159181

160182
coveralls-finish:
161183
name: Coveralls Finished
162184
runs-on: ubuntu-latest
163-
needs: setup-build-test-node-20
185+
needs: [setup-build-test-node-20, test-postgrest-js]
164186
steps:
165187
- name: Coveralls Finished
166188
uses: coverallsapp/github-action@v2

nx.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@
137137
"cache": true,
138138
"outputs": ["{projectRoot}/coverage"]
139139
},
140+
"test:ci:postgrest": {
141+
"inputs": ["testing", "^production"],
142+
"dependsOn": ["build"],
143+
"cache": true,
144+
"outputs": ["{projectRoot}/coverage"]
145+
},
140146
"vite:test": {
141147
"inputs": ["testing", "^production"],
142148
"cache": true,

packages/core/postgrest-js/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
"build:esm": "cpy wrapper.mjs dist/esm/",
4040
"docs": "typedoc src/index.ts --out docs/v2",
4141
"docs:json": "typedoc --json docs/v2/spec.json --excludeExternals src/index.ts",
42-
"test": "npm run format:check && npm run test:types && npm run db:clean && npm run db:run && npm run test:run && npm run db:clean && node test/smoke.cjs && node test/smoke.mjs",
43-
"test:ci": "npm run db:clean && npm run db:run && npm run test:run && npm run db:clean && npm run test:smoke",
42+
"test:ci:postgrest": "npm run db:clean && npm run db:run && npm run test:run && npm run db:clean && npm run test:smoke",
4443
"test:run": "jest --runInBand --coverage",
4544
"test:smoke": "node test/smoke.cjs && node test/smoke.mjs",
4645
"test:update": "npm run db:clean && npm run db:run && npm run db:generate-test-types && jest --runInBand --updateSnapshot && npm run db:clean",

0 commit comments

Comments
 (0)