|
9 | 9 | name: PouchDB CI |
10 | 10 |
|
11 | 11 | on: |
12 | | - push: {} |
| 12 | + push: |
| 13 | + paths-ignore: |
| 14 | + - '.github/ISSUE_TEMPLATE/' |
| 15 | + - '.github/PULL_REQUEST_TEMPLATE.md' |
| 16 | + - 'CONTRIBUTING.md' |
| 17 | + - 'DISCLAIMER' |
| 18 | + - 'LICENSE' |
| 19 | + - 'NOTICE' |
| 20 | + - 'README.md' |
| 21 | + - 'TESTING.md' |
| 22 | + - 'docs/**' |
13 | 23 | pull_request: |
14 | 24 | branches: [master] |
| 25 | + paths-ignore: |
| 26 | + - '.github/ISSUE_TEMPLATE/' |
| 27 | + - '.github/PULL_REQUEST_TEMPLATE.md' |
| 28 | + - 'CONTRIBUTING.md' |
| 29 | + - 'DISCLAIMER' |
| 30 | + - 'LICENSE' |
| 31 | + - 'NOTICE' |
| 32 | + - 'README.md' |
| 33 | + - 'TESTING.md' |
| 34 | + - 'docs/**' |
15 | 35 |
|
16 | 36 | env: |
17 | 37 | NODE_VERSION: 22 |
@@ -174,13 +194,28 @@ jobs: |
174 | 194 | - TYPE=find PLUGINS=pouchdb-find npm test |
175 | 195 | - TYPE=mapreduce npm test |
176 | 196 | runs-on: ubuntu-latest |
| 197 | + services: |
| 198 | + couchdb: |
| 199 | + image: couchdb:3.1 |
| 200 | + ports: |
| 201 | + - 5984:5984 |
| 202 | + env: |
| 203 | + COUCHDB_USER: admin |
| 204 | + COUCHDB_PASSWORD: password |
177 | 205 | env: |
178 | 206 | CLIENT: node |
| 207 | + SERVER: couchdb-master |
| 208 | + COUCH_HOST: http://admin:password@127.0.0.1:5984 |
| 209 | + SKIP_MIGRATION: 1 |
179 | 210 | ADAPTERS: ${{ matrix.adapter }} |
180 | 211 | steps: |
181 | 212 | - uses: actions/checkout@v4 |
182 | 213 | with: |
183 | 214 | persist-credentials: false |
| 215 | + - name: Wait for CouchDB |
| 216 | + run: ./bin/wait-for-couch.sh 20 |
| 217 | + - name: Setup CouchDB CORS |
| 218 | + run: curl 'http://admin:password@127.0.0.1:5984/_node/_local/_config/cors/origins' -X PUT -d '"http://127.0.0.1:8000"' |
184 | 219 | - uses: ./.github/actions/install-node-package |
185 | 220 | with: |
186 | 221 | node-version: ${{ matrix.node }} |
@@ -213,14 +248,29 @@ jobs: |
213 | 248 | - TYPE=find PLUGINS=pouchdb-find npm test |
214 | 249 | - TYPE=mapreduce npm test |
215 | 250 | runs-on: ubuntu-latest |
| 251 | + services: |
| 252 | + couchdb: |
| 253 | + image: couchdb:3.1 |
| 254 | + ports: |
| 255 | + - 5984:5984 |
| 256 | + env: |
| 257 | + COUCHDB_USER: admin |
| 258 | + COUCHDB_PASSWORD: password |
216 | 259 | env: |
| 260 | + SERVER: couchdb-master |
| 261 | + COUCH_HOST: http://admin:password@127.0.0.1:5984 |
| 262 | + SKIP_MIGRATION: 1 |
217 | 263 | USE_MINIFIED: 1 |
218 | 264 | CLIENT: ${{ matrix.client }} |
219 | 265 | ADAPTERS: ${{ matrix.adapter }} |
220 | 266 | steps: |
221 | 267 | - uses: actions/checkout@v4 |
222 | 268 | with: |
223 | 269 | persist-credentials: false |
| 270 | + - name: Wait for CouchDB |
| 271 | + run: ./bin/wait-for-couch.sh 20 |
| 272 | + - name: Setup CouchDB CORS |
| 273 | + run: curl 'http://admin:password@127.0.0.1:5984/_node/_local/_config/cors/origins' -X PUT -d '"http://127.0.0.1:8000"' |
224 | 274 | - uses: ./.github/actions/install-node-package |
225 | 275 | with: |
226 | 276 | node-version: ${{ env.NODE_VERSION }} |
@@ -249,12 +299,55 @@ jobs: |
249 | 299 | cmd: |
250 | 300 | - CLIENT=firefox npm run test-webpack |
251 | 301 | - AUTO_COMPACTION=true npm test |
252 | | - - TYPE=performance npm test |
253 | 302 | - npm run test-unit |
254 | 303 | - npm run test-component |
255 | 304 | - npm run test-fuzzy |
256 | 305 | - npm run verify-build |
257 | 306 | runs-on: ubuntu-latest |
| 307 | + env: |
| 308 | + SERVER: couchdb-master |
| 309 | + COUCH_HOST: http://admin:password@127.0.0.1:5984 |
| 310 | + services: |
| 311 | + couchdb: |
| 312 | + image: couchdb:3.1 |
| 313 | + ports: |
| 314 | + - 5984:5984 |
| 315 | + env: |
| 316 | + COUCHDB_USER: admin |
| 317 | + COUCHDB_PASSWORD: password |
| 318 | + steps: |
| 319 | + - uses: actions/checkout@v4 |
| 320 | + with: |
| 321 | + persist-credentials: false |
| 322 | + - name: Wait for CouchDB |
| 323 | + run: ./bin/wait-for-couch.sh 20 |
| 324 | + - name: Setup CouchDB CORS |
| 325 | + run: curl 'http://admin:password@127.0.0.1:5984/_node/_local/_config/cors/origins' -X PUT -d '"http://127.0.0.1:8000"' |
| 326 | + - uses: ./.github/actions/install-node-package |
| 327 | + with: |
| 328 | + node-version: ${{ matrix.node }} |
| 329 | + - uses: ./.github/actions/build-pouchdb |
| 330 | + - id: test |
| 331 | + run: ${{ matrix.cmd }} |
| 332 | + continue-on-error: true |
| 333 | + - name: First retry |
| 334 | + id: retry |
| 335 | + if: steps.test.outcome == 'failure' |
| 336 | + run: git reset --hard && ${{ matrix.cmd }} |
| 337 | + continue-on-error: true |
| 338 | + - name: Second retry |
| 339 | + if: steps.retry.outcome == 'failure' |
| 340 | + run: git reset --hard && ${{ matrix.cmd }} |
| 341 | + |
| 342 | + nodejs-perf: |
| 343 | + needs: lint |
| 344 | + strategy: |
| 345 | + fail-fast: false |
| 346 | + matrix: |
| 347 | + node: [20, 22] |
| 348 | + cmd: |
| 349 | + - TYPE=performance npm test |
| 350 | + runs-on: ubuntu-latest |
258 | 351 | steps: |
259 | 352 | - uses: actions/checkout@v4 |
260 | 353 | with: |
|
0 commit comments