From cfbf6f02fbeaabb3843cd71daa53a4476bf5d5b4 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Wed, 6 Sep 2023 09:28:33 +0000 Subject: [PATCH 1/9] add test for docs --- .github/workflows/ci.yml | 472 ++++++++++++++++++++------------------- 1 file changed, 243 insertions(+), 229 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86c86bee48..a3cbbb6a79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,236 +19,250 @@ env: jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/install-deps - with: - node-version: ${{ env.NODE_VERSION }} - - run: npm run eslint - - # Run the integration, find and mapreduce tests against CouchDB on Node.js. - # This should be run against every version of CouchDB and every version of - # Node.js we support. - - couchdb-nodejs: - needs: lint - strategy: - fail-fast: false - matrix: - couchdb: ['2.3', '3.1'] - node: [14, 16] - cmd: - - npm test - - TYPE=find PLUGINS=pouchdb-find ADAPTERS=http npm test - - TYPE=mapreduce ADAPTERS=http npm test - runs-on: ubuntu-latest - env: - CLIENT: node - SERVER: couchdb-master - COUCH_HOST: http://admin:password@127.0.0.1:5984 - SKIP_MIGRATION: 1 - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/install-deps - with: - node-version: ${{ matrix.node }} - couchdb-version: ${{ matrix.couchdb }} - - id: test - run: ${{ matrix.cmd }} - continue-on-error: true - - name: First retry - id: retry - if: steps.test.outcome == 'failure' - run: ${{ matrix.cmd }} - continue-on-error: true - - name: Second retry - if: steps.retry.outcome == 'failure' - run: ${{ matrix.cmd }} - - # Run the integration, find and mapreduce tests against CouchDB in the - # browser. This should be run against every version of CouchDB we support and - # every target browser. - - couchdb-browser: - needs: lint - strategy: - fail-fast: false - matrix: - couchdb: ['2.3','3.1'] - client: ['firefox', 'chromium'] - cmd: - - npm test - - TYPE=find PLUGINS=pouchdb-find ADAPTERS=http npm test - - TYPE=mapreduce ADAPTERS=http npm test - runs-on: ubuntu-latest - env: - POUCHDB_SRC: ../../packages/node_modules/pouchdb/dist/pouchdb.min.js - CLIENT: ${{ matrix.client }} - SERVER: couchdb-master - COUCH_HOST: http://admin:password@127.0.0.1:5984 - SKIP_MIGRATION: 1 - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/install-deps - with: - node-version: ${{ env.NODE_VERSION }} - couchdb-version: ${{ matrix.couchdb }} - - id: test - run: ${{ matrix.cmd }} - continue-on-error: true - - name: First retry - id: retry - if: steps.test.outcome == 'failure' - run: ${{ matrix.cmd }} - continue-on-error: true - - name: Second retry - if: steps.retry.outcome == 'failure' - run: ${{ matrix.cmd }} - - # Run the integration, find and mapreduce tests against all the Node.js - # PouchDB adapters. This should be run for every adapter on every version of - # Node.js we support. - - nodejs-adapter: - needs: lint - strategy: - fail-fast: false - matrix: - node: [14, 16] - adapter: ['leveldb', 'memory'] - cmd: - - npm test - - TYPE=find PLUGINS=pouchdb-find npm test - - TYPE=mapreduce npm test - runs-on: ubuntu-latest - env: - CLIENT: node - ADAPTERS: ${{ matrix.adapter }} - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/install-deps - with: - node-version: ${{ matrix.node }} - - id: test - run: ${{ matrix.cmd }} - continue-on-error: true - - name: First retry - id: retry - if: steps.test.outcome == 'failure' - run: ${{ matrix.cmd }} - continue-on-error: true - - name: Second retry - if: steps.retry.outcome == 'failure' - run: ${{ matrix.cmd }} - - # Run the integration, find and mapreduce tests against all the browser-based - # adapters. PouchDB adapters. This should be run for every adapter on every - # target browser. - - browser-adapter: - needs: lint - strategy: - fail-fast: false - matrix: - client: ['firefox', 'chromium'] - adapter: ['idb', 'indexeddb', 'memory'] - cmd: - - npm test - - TYPE=find PLUGINS=pouchdb-find npm test - - TYPE=mapreduce npm test - runs-on: ubuntu-latest - env: - POUCHDB_SRC: ../../packages/node_modules/pouchdb/dist/pouchdb.min.js - CLIENT: ${{ matrix.client }} - ADAPTERS: ${{ matrix.adapter }} - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/install-deps - with: - node-version: ${{ env.NODE_VERSION }} - - id: test - run: ${{ matrix.cmd }} - continue-on-error: true - - name: First retry - id: retry - if: steps.test.outcome == 'failure' - run: ${{ matrix.cmd }} - continue-on-error: true - - name: Second retry - if: steps.retry.outcome == 'failure' - run: ${{ matrix.cmd }} - - # Run the integration, find and mapreduce tests using pouchdb-server as the - # remote adapter. This checks that pouchdb-server works with the current - # PouchDB source tree. We run this on Node.js and on every target browser. - # Running against different versions of Node.js might require splitting this - # out into a distinct job. - - pouchdb-server: - needs: lint - strategy: - fail-fast: false - matrix: - client: ['node', 'firefox', 'chromium'] - cmd: - - npm test - - TYPE=find PLUGINS=pouchdb-find ADAPTERS=http npm test - - TYPE=mapreduce ADAPTERS=http npm test - runs-on: ubuntu-latest - env: - CLIENT: ${{ matrix.client }} - SERVER: pouchdb-server - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/install-deps - with: - node-version: ${{ env.NODE_VERSION }} - - id: test - run: ${{ matrix.cmd }} - continue-on-error: true - - name: First retry - id: retry - if: steps.test.outcome == 'failure' - run: ${{ matrix.cmd }} - continue-on-error: true - - name: Second retry - if: steps.retry.outcome == 'failure' - run: ${{ matrix.cmd }} - - # Run all the other testing tasks -- unit tests, and so on. These should be - # run on every version of Node.js that we support. +# lint: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - uses: ./.github/actions/install-deps +# with: +# node-version: ${{ env.NODE_VERSION }} +# - run: npm run eslint +# +# # Run the integration, find and mapreduce tests against CouchDB on Node.js. +# # This should be run against every version of CouchDB and every version of +# # Node.js we support. +# +# couchdb-nodejs: +# needs: lint +# strategy: +# fail-fast: false +# matrix: +# couchdb: ['2.3', '3.1'] +# node: [14, 16] +# cmd: +# - npm test +# - TYPE=find PLUGINS=pouchdb-find ADAPTERS=http npm test +# - TYPE=mapreduce ADAPTERS=http npm test +# runs-on: ubuntu-latest +# env: +# CLIENT: node +# SERVER: couchdb-master +# COUCH_HOST: http://admin:password@127.0.0.1:5984 +# SKIP_MIGRATION: 1 +# steps: +# - uses: actions/checkout@v3 +# - uses: ./.github/actions/install-deps +# with: +# node-version: ${{ matrix.node }} +# couchdb-version: ${{ matrix.couchdb }} +# - id: test +# run: ${{ matrix.cmd }} +# continue-on-error: true +# - name: First retry +# id: retry +# if: steps.test.outcome == 'failure' +# run: ${{ matrix.cmd }} +# continue-on-error: true +# - name: Second retry +# if: steps.retry.outcome == 'failure' +# run: ${{ matrix.cmd }} +# +# # Run the integration, find and mapreduce tests against CouchDB in the +# # browser. This should be run against every version of CouchDB we support and +# # every target browser. +# +# couchdb-browser: +# needs: lint +# strategy: +# fail-fast: false +# matrix: +# couchdb: ['2.3','3.1'] +# client: ['firefox', 'chromium'] +# cmd: +# - npm test +# - TYPE=find PLUGINS=pouchdb-find ADAPTERS=http npm test +# - TYPE=mapreduce ADAPTERS=http npm test +# runs-on: ubuntu-latest +# env: +# POUCHDB_SRC: ../../packages/node_modules/pouchdb/dist/pouchdb.min.js +# CLIENT: ${{ matrix.client }} +# SERVER: couchdb-master +# COUCH_HOST: http://admin:password@127.0.0.1:5984 +# SKIP_MIGRATION: 1 +# steps: +# - uses: actions/checkout@v3 +# - uses: ./.github/actions/install-deps +# with: +# node-version: ${{ env.NODE_VERSION }} +# couchdb-version: ${{ matrix.couchdb }} +# - id: test +# run: ${{ matrix.cmd }} +# continue-on-error: true +# - name: First retry +# id: retry +# if: steps.test.outcome == 'failure' +# run: ${{ matrix.cmd }} +# continue-on-error: true +# - name: Second retry +# if: steps.retry.outcome == 'failure' +# run: ${{ matrix.cmd }} +# +# # Run the integration, find and mapreduce tests against all the Node.js +# # PouchDB adapters. This should be run for every adapter on every version of +# # Node.js we support. +# +# nodejs-adapter: +# needs: lint +# strategy: +# fail-fast: false +# matrix: +# node: [14, 16] +# adapter: ['leveldb', 'memory'] +# cmd: +# - npm test +# - TYPE=find PLUGINS=pouchdb-find npm test +# - TYPE=mapreduce npm test +# runs-on: ubuntu-latest +# env: +# CLIENT: node +# ADAPTERS: ${{ matrix.adapter }} +# steps: +# - uses: actions/checkout@v3 +# - uses: ./.github/actions/install-deps +# with: +# node-version: ${{ matrix.node }} +# - id: test +# run: ${{ matrix.cmd }} +# continue-on-error: true +# - name: First retry +# id: retry +# if: steps.test.outcome == 'failure' +# run: ${{ matrix.cmd }} +# continue-on-error: true +# - name: Second retry +# if: steps.retry.outcome == 'failure' +# run: ${{ matrix.cmd }} +# +# # Run the integration, find and mapreduce tests against all the browser-based +# # adapters. PouchDB adapters. This should be run for every adapter on every +# # target browser. +# +# browser-adapter: +# needs: lint +# strategy: +# fail-fast: false +# matrix: +# client: ['firefox', 'chromium'] +# adapter: ['idb', 'indexeddb', 'memory'] +# cmd: +# - npm test +# - TYPE=find PLUGINS=pouchdb-find npm test +# - TYPE=mapreduce npm test +# runs-on: ubuntu-latest +# env: +# POUCHDB_SRC: ../../packages/node_modules/pouchdb/dist/pouchdb.min.js +# CLIENT: ${{ matrix.client }} +# ADAPTERS: ${{ matrix.adapter }} +# steps: +# - uses: actions/checkout@v3 +# - uses: ./.github/actions/install-deps +# with: +# node-version: ${{ env.NODE_VERSION }} +# - id: test +# run: ${{ matrix.cmd }} +# continue-on-error: true +# - name: First retry +# id: retry +# if: steps.test.outcome == 'failure' +# run: ${{ matrix.cmd }} +# continue-on-error: true +# - name: Second retry +# if: steps.retry.outcome == 'failure' +# run: ${{ matrix.cmd }} +# +# # Run the integration, find and mapreduce tests using pouchdb-server as the +# # remote adapter. This checks that pouchdb-server works with the current +# # PouchDB source tree. We run this on Node.js and on every target browser. +# # Running against different versions of Node.js might require splitting this +# # out into a distinct job. +# +# pouchdb-server: +# needs: lint +# strategy: +# fail-fast: false +# matrix: +# client: ['node', 'firefox', 'chromium'] +# cmd: +# - npm test +# - TYPE=find PLUGINS=pouchdb-find ADAPTERS=http npm test +# - TYPE=mapreduce ADAPTERS=http npm test +# runs-on: ubuntu-latest +# env: +# CLIENT: ${{ matrix.client }} +# SERVER: pouchdb-server +# steps: +# - uses: actions/checkout@v3 +# - uses: ./.github/actions/install-deps +# with: +# node-version: ${{ env.NODE_VERSION }} +# - id: test +# run: ${{ matrix.cmd }} +# continue-on-error: true +# - name: First retry +# id: retry +# if: steps.test.outcome == 'failure' +# run: ${{ matrix.cmd }} +# continue-on-error: true +# - name: Second retry +# if: steps.retry.outcome == 'failure' +# run: ${{ matrix.cmd }} +# +# # Run all the other testing tasks -- unit tests, and so on. These should be +# # run on every version of Node.js that we support. +# +# nodejs: +# needs: lint +# strategy: +# fail-fast: false +# matrix: +# node: [14, 16] +# cmd: +# - CLIENT=firefox npm run test-webpack +# - AUTO_COMPACTION=true npm test +# - PERF=1 npm test +# - npm run test-unit +# - npm run test-component +# - npm run test-fuzzy +# # - SERVER=pouchdb-server POUCHDB_SERVER_FLAGS=--in-memory PLUGINS=pouchdb-find npm run report-coverage +# - npm run verify-build +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - uses: ./.github/actions/install-deps +# with: +# node-version: ${{ matrix.node }} +# - id: test +# run: ${{ matrix.cmd }} +# continue-on-error: true +# - name: First retry +# id: retry +# if: steps.test.outcome == 'failure' +# run: git reset --hard && ${{ matrix.cmd }} +# continue-on-error: true +# - name: Second retry +# if: steps.retry.outcome == 'failure' +# run: git reset --hard && ${{ matrix.cmd }} - nodejs: - needs: lint - strategy: - fail-fast: false - matrix: - node: [14, 16] - cmd: - - CLIENT=firefox npm run test-webpack - - AUTO_COMPACTION=true npm test - - PERF=1 npm test - - npm run test-unit - - npm run test-component - - npm run test-fuzzy - # - SERVER=pouchdb-server POUCHDB_SERVER_FLAGS=--in-memory PLUGINS=pouchdb-find npm run report-coverage - - npm run verify-build - runs-on: ubuntu-latest + test-docs: + runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - uses: ./.github/actions/install-deps + - uses: ruby/setup-ruby@v1 with: - node-version: ${{ matrix.node }} - - id: test - run: ${{ matrix.cmd }} - continue-on-error: true - - name: First retry - id: retry - if: steps.test.outcome == 'failure' - run: git reset --hard && ${{ matrix.cmd }} - continue-on-error: true - - name: Second retry - if: steps.retry.outcome == 'failure' - run: git reset --hard && ${{ matrix.cmd }} + ruby-version: 2.7 + bundler-cache: true + - run: sudo gem install bundler -v 2.1.4 + - run: npm run install-jekyll + - run: BUILD=1 npm run build-site From 55a767a4b64d0cfa7ad5430459668e2d7e1f7348 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Wed, 6 Sep 2023 09:29:13 +0000 Subject: [PATCH 2/9] try breaking the docs --- docs/index.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/index.md b/docs/index.md index 9d67e38d53..7490d02b75 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,5 +1,5 @@ --- -layout: default +layout: defalt title: PouchDB, the JavaScript Database that Syncs! --- @@ -13,7 +13,7 @@ title: PouchDB, the JavaScript Database that Syncs!

The Database that Syncs!

-

PouchDB is an open-source JavaScript database inspired by Apache CouchDB that is designed to run well within the browser.

+ PouchDB is an open-source JavaScript database inspired by Apache CouchDB that is designed to run well within the browser.

PouchDB was created to help web developers build applications that work as well offline as they do online.

It enables applications to store data locally while offline, then synchronize it with CouchDB and compatible servers when the application is back online, keeping the user's data in sync no matter where they next login.

@@ -24,7 +24,8 @@ title: PouchDB, the JavaScript Database that Syncs!
-{% highlight js %} +{% lowlight 9regfu0r80yy %} +{% highlight 9regfu0r80yy %} var db = new PouchDB('dbname'); db.put({ From 6dc3450cadd844e2de4f1f32ae2bacacf9febe90 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Wed, 6 Sep 2023 09:30:00 +0000 Subject: [PATCH 3/9] fix indentation --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3cbbb6a79..ba69e197d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -254,7 +254,7 @@ jobs: # run: git reset --hard && ${{ matrix.cmd }} test-docs: - runs-on: ubuntu-20.04 + runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@v3 From 76747d092d641320bbc57d5e34f662a33d8906c9 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Wed, 6 Sep 2023 09:30:08 +0000 Subject: [PATCH 4/9] Revert "try breaking the docs" This reverts commit 55a767a4b64d0cfa7ad5430459668e2d7e1f7348. --- docs/index.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/index.md b/docs/index.md index 7490d02b75..9d67e38d53 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,5 +1,5 @@ --- -layout: defalt +layout: default title: PouchDB, the JavaScript Database that Syncs! --- @@ -13,7 +13,7 @@ title: PouchDB, the JavaScript Database that Syncs!

The Database that Syncs!

- PouchDB is an open-source JavaScript database inspired by Apache CouchDB that is designed to run well within the browser.

+

PouchDB is an open-source JavaScript database inspired by Apache CouchDB that is designed to run well within the browser.

PouchDB was created to help web developers build applications that work as well offline as they do online.

It enables applications to store data locally while offline, then synchronize it with CouchDB and compatible servers when the application is back online, keeping the user's data in sync no matter where they next login.

@@ -24,8 +24,7 @@ title: PouchDB, the JavaScript Database that Syncs!
-{% lowlight 9regfu0r80yy %} -{% highlight 9regfu0r80yy %} +{% highlight js %} var db = new PouchDB('dbname'); db.put({ From f2990c59bd647cf2eeb988eabcfafbfe4885a4be Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Wed, 6 Sep 2023 09:41:43 +0000 Subject: [PATCH 5/9] fiddle with paths --- .github/workflows/ci.yml | 268 ------------------------------------- .github/workflows/docs.yml | 30 +++++ 2 files changed, 30 insertions(+), 268 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index ba69e197d3..0000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,268 +0,0 @@ -# This workflow will do a clean install of node dependencies, cache/restore -# them, build the source code and run tests across different versions of node -# For more information see: -# https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -# -# See supported Node.js release schedule at -# https://nodejs.org/en/about/releases/ - -name: PouchDB CI - -on: - push: {} - pull_request: - branches: [master] - -env: - NODE_VERSION: 14 - TEST_HOST: localhost - -jobs: - -# lint: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - uses: ./.github/actions/install-deps -# with: -# node-version: ${{ env.NODE_VERSION }} -# - run: npm run eslint -# -# # Run the integration, find and mapreduce tests against CouchDB on Node.js. -# # This should be run against every version of CouchDB and every version of -# # Node.js we support. -# -# couchdb-nodejs: -# needs: lint -# strategy: -# fail-fast: false -# matrix: -# couchdb: ['2.3', '3.1'] -# node: [14, 16] -# cmd: -# - npm test -# - TYPE=find PLUGINS=pouchdb-find ADAPTERS=http npm test -# - TYPE=mapreduce ADAPTERS=http npm test -# runs-on: ubuntu-latest -# env: -# CLIENT: node -# SERVER: couchdb-master -# COUCH_HOST: http://admin:password@127.0.0.1:5984 -# SKIP_MIGRATION: 1 -# steps: -# - uses: actions/checkout@v3 -# - uses: ./.github/actions/install-deps -# with: -# node-version: ${{ matrix.node }} -# couchdb-version: ${{ matrix.couchdb }} -# - id: test -# run: ${{ matrix.cmd }} -# continue-on-error: true -# - name: First retry -# id: retry -# if: steps.test.outcome == 'failure' -# run: ${{ matrix.cmd }} -# continue-on-error: true -# - name: Second retry -# if: steps.retry.outcome == 'failure' -# run: ${{ matrix.cmd }} -# -# # Run the integration, find and mapreduce tests against CouchDB in the -# # browser. This should be run against every version of CouchDB we support and -# # every target browser. -# -# couchdb-browser: -# needs: lint -# strategy: -# fail-fast: false -# matrix: -# couchdb: ['2.3','3.1'] -# client: ['firefox', 'chromium'] -# cmd: -# - npm test -# - TYPE=find PLUGINS=pouchdb-find ADAPTERS=http npm test -# - TYPE=mapreduce ADAPTERS=http npm test -# runs-on: ubuntu-latest -# env: -# POUCHDB_SRC: ../../packages/node_modules/pouchdb/dist/pouchdb.min.js -# CLIENT: ${{ matrix.client }} -# SERVER: couchdb-master -# COUCH_HOST: http://admin:password@127.0.0.1:5984 -# SKIP_MIGRATION: 1 -# steps: -# - uses: actions/checkout@v3 -# - uses: ./.github/actions/install-deps -# with: -# node-version: ${{ env.NODE_VERSION }} -# couchdb-version: ${{ matrix.couchdb }} -# - id: test -# run: ${{ matrix.cmd }} -# continue-on-error: true -# - name: First retry -# id: retry -# if: steps.test.outcome == 'failure' -# run: ${{ matrix.cmd }} -# continue-on-error: true -# - name: Second retry -# if: steps.retry.outcome == 'failure' -# run: ${{ matrix.cmd }} -# -# # Run the integration, find and mapreduce tests against all the Node.js -# # PouchDB adapters. This should be run for every adapter on every version of -# # Node.js we support. -# -# nodejs-adapter: -# needs: lint -# strategy: -# fail-fast: false -# matrix: -# node: [14, 16] -# adapter: ['leveldb', 'memory'] -# cmd: -# - npm test -# - TYPE=find PLUGINS=pouchdb-find npm test -# - TYPE=mapreduce npm test -# runs-on: ubuntu-latest -# env: -# CLIENT: node -# ADAPTERS: ${{ matrix.adapter }} -# steps: -# - uses: actions/checkout@v3 -# - uses: ./.github/actions/install-deps -# with: -# node-version: ${{ matrix.node }} -# - id: test -# run: ${{ matrix.cmd }} -# continue-on-error: true -# - name: First retry -# id: retry -# if: steps.test.outcome == 'failure' -# run: ${{ matrix.cmd }} -# continue-on-error: true -# - name: Second retry -# if: steps.retry.outcome == 'failure' -# run: ${{ matrix.cmd }} -# -# # Run the integration, find and mapreduce tests against all the browser-based -# # adapters. PouchDB adapters. This should be run for every adapter on every -# # target browser. -# -# browser-adapter: -# needs: lint -# strategy: -# fail-fast: false -# matrix: -# client: ['firefox', 'chromium'] -# adapter: ['idb', 'indexeddb', 'memory'] -# cmd: -# - npm test -# - TYPE=find PLUGINS=pouchdb-find npm test -# - TYPE=mapreduce npm test -# runs-on: ubuntu-latest -# env: -# POUCHDB_SRC: ../../packages/node_modules/pouchdb/dist/pouchdb.min.js -# CLIENT: ${{ matrix.client }} -# ADAPTERS: ${{ matrix.adapter }} -# steps: -# - uses: actions/checkout@v3 -# - uses: ./.github/actions/install-deps -# with: -# node-version: ${{ env.NODE_VERSION }} -# - id: test -# run: ${{ matrix.cmd }} -# continue-on-error: true -# - name: First retry -# id: retry -# if: steps.test.outcome == 'failure' -# run: ${{ matrix.cmd }} -# continue-on-error: true -# - name: Second retry -# if: steps.retry.outcome == 'failure' -# run: ${{ matrix.cmd }} -# -# # Run the integration, find and mapreduce tests using pouchdb-server as the -# # remote adapter. This checks that pouchdb-server works with the current -# # PouchDB source tree. We run this on Node.js and on every target browser. -# # Running against different versions of Node.js might require splitting this -# # out into a distinct job. -# -# pouchdb-server: -# needs: lint -# strategy: -# fail-fast: false -# matrix: -# client: ['node', 'firefox', 'chromium'] -# cmd: -# - npm test -# - TYPE=find PLUGINS=pouchdb-find ADAPTERS=http npm test -# - TYPE=mapreduce ADAPTERS=http npm test -# runs-on: ubuntu-latest -# env: -# CLIENT: ${{ matrix.client }} -# SERVER: pouchdb-server -# steps: -# - uses: actions/checkout@v3 -# - uses: ./.github/actions/install-deps -# with: -# node-version: ${{ env.NODE_VERSION }} -# - id: test -# run: ${{ matrix.cmd }} -# continue-on-error: true -# - name: First retry -# id: retry -# if: steps.test.outcome == 'failure' -# run: ${{ matrix.cmd }} -# continue-on-error: true -# - name: Second retry -# if: steps.retry.outcome == 'failure' -# run: ${{ matrix.cmd }} -# -# # Run all the other testing tasks -- unit tests, and so on. These should be -# # run on every version of Node.js that we support. -# -# nodejs: -# needs: lint -# strategy: -# fail-fast: false -# matrix: -# node: [14, 16] -# cmd: -# - CLIENT=firefox npm run test-webpack -# - AUTO_COMPACTION=true npm test -# - PERF=1 npm test -# - npm run test-unit -# - npm run test-component -# - npm run test-fuzzy -# # - SERVER=pouchdb-server POUCHDB_SERVER_FLAGS=--in-memory PLUGINS=pouchdb-find npm run report-coverage -# - npm run verify-build -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - uses: ./.github/actions/install-deps -# with: -# node-version: ${{ matrix.node }} -# - id: test -# run: ${{ matrix.cmd }} -# continue-on-error: true -# - name: First retry -# id: retry -# if: steps.test.outcome == 'failure' -# run: git reset --hard && ${{ matrix.cmd }} -# continue-on-error: true -# - name: Second retry -# if: steps.retry.outcome == 'failure' -# run: git reset --hard && ${{ matrix.cmd }} - - test-docs: - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@v3 - - uses: ./.github/actions/install-deps - - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.7 - bundler-cache: true - - run: sudo gem install bundler -v 2.1.4 - - run: npm run install-jekyll - - run: BUILD=1 npm run build-site diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..9ffdbd38b7 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,30 @@ +name: PouchDB Docs + +on: + push: + paths: + - 'bin/**' + - 'docs/**' + - 'package.json' + pull_request: + branches: [master] + paths: + - 'bin/**' + - 'docs/**' + - 'package.json' + +jobs: + + test-docs: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: ./.github/actions/install-deps + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true + - run: sudo gem install bundler -v 2.1.4 + - run: npm run install-jekyll + - run: BUILD=1 npm run build-site From d39b6018108604466507a859b49216a944261580 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Wed, 6 Sep 2023 09:42:00 +0000 Subject: [PATCH 6/9] try breaking the build --- docs/index.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/index.md b/docs/index.md index 9d67e38d53..7490d02b75 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,5 +1,5 @@ --- -layout: default +layout: defalt title: PouchDB, the JavaScript Database that Syncs! --- @@ -13,7 +13,7 @@ title: PouchDB, the JavaScript Database that Syncs!

The Database that Syncs!

-

PouchDB is an open-source JavaScript database inspired by Apache CouchDB that is designed to run well within the browser.

+ PouchDB is an open-source JavaScript database inspired by Apache CouchDB that is designed to run well within the browser.

PouchDB was created to help web developers build applications that work as well offline as they do online.

It enables applications to store data locally while offline, then synchronize it with CouchDB and compatible servers when the application is back online, keeping the user's data in sync no matter where they next login.

@@ -24,7 +24,8 @@ title: PouchDB, the JavaScript Database that Syncs!
-{% highlight js %} +{% lowlight 9regfu0r80yy %} +{% highlight 9regfu0r80yy %} var db = new PouchDB('dbname'); db.put({ From 30226bb62b3143c312fa9bc362d445b6303e4458 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Wed, 6 Sep 2023 09:42:12 +0000 Subject: [PATCH 7/9] Revert "try breaking the build" This reverts commit d39b6018108604466507a859b49216a944261580. --- docs/index.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/index.md b/docs/index.md index 7490d02b75..9d67e38d53 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,5 +1,5 @@ --- -layout: defalt +layout: default title: PouchDB, the JavaScript Database that Syncs! --- @@ -13,7 +13,7 @@ title: PouchDB, the JavaScript Database that Syncs!

The Database that Syncs!

- PouchDB is an open-source JavaScript database inspired by Apache CouchDB that is designed to run well within the browser.

+

PouchDB is an open-source JavaScript database inspired by Apache CouchDB that is designed to run well within the browser.

PouchDB was created to help web developers build applications that work as well offline as they do online.

It enables applications to store data locally while offline, then synchronize it with CouchDB and compatible servers when the application is back online, keeping the user's data in sync no matter where they next login.

@@ -24,8 +24,7 @@ title: PouchDB, the JavaScript Database that Syncs!
-{% lowlight 9regfu0r80yy %} -{% highlight 9regfu0r80yy %} +{% highlight js %} var db = new PouchDB('dbname'); db.put({ From 2732e07791e757712556b235f071451d9c30ebd6 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Wed, 6 Sep 2023 09:49:35 +0000 Subject: [PATCH 8/9] re-intro gha --- .github/workflows/ci.yml | 254 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 254 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..86c86bee48 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,254 @@ +# This workflow will do a clean install of node dependencies, cache/restore +# them, build the source code and run tests across different versions of node +# For more information see: +# https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# +# See supported Node.js release schedule at +# https://nodejs.org/en/about/releases/ + +name: PouchDB CI + +on: + push: {} + pull_request: + branches: [master] + +env: + NODE_VERSION: 14 + TEST_HOST: localhost + +jobs: + + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/install-deps + with: + node-version: ${{ env.NODE_VERSION }} + - run: npm run eslint + + # Run the integration, find and mapreduce tests against CouchDB on Node.js. + # This should be run against every version of CouchDB and every version of + # Node.js we support. + + couchdb-nodejs: + needs: lint + strategy: + fail-fast: false + matrix: + couchdb: ['2.3', '3.1'] + node: [14, 16] + cmd: + - npm test + - TYPE=find PLUGINS=pouchdb-find ADAPTERS=http npm test + - TYPE=mapreduce ADAPTERS=http npm test + runs-on: ubuntu-latest + env: + CLIENT: node + SERVER: couchdb-master + COUCH_HOST: http://admin:password@127.0.0.1:5984 + SKIP_MIGRATION: 1 + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/install-deps + with: + node-version: ${{ matrix.node }} + couchdb-version: ${{ matrix.couchdb }} + - id: test + run: ${{ matrix.cmd }} + continue-on-error: true + - name: First retry + id: retry + if: steps.test.outcome == 'failure' + run: ${{ matrix.cmd }} + continue-on-error: true + - name: Second retry + if: steps.retry.outcome == 'failure' + run: ${{ matrix.cmd }} + + # Run the integration, find and mapreduce tests against CouchDB in the + # browser. This should be run against every version of CouchDB we support and + # every target browser. + + couchdb-browser: + needs: lint + strategy: + fail-fast: false + matrix: + couchdb: ['2.3','3.1'] + client: ['firefox', 'chromium'] + cmd: + - npm test + - TYPE=find PLUGINS=pouchdb-find ADAPTERS=http npm test + - TYPE=mapreduce ADAPTERS=http npm test + runs-on: ubuntu-latest + env: + POUCHDB_SRC: ../../packages/node_modules/pouchdb/dist/pouchdb.min.js + CLIENT: ${{ matrix.client }} + SERVER: couchdb-master + COUCH_HOST: http://admin:password@127.0.0.1:5984 + SKIP_MIGRATION: 1 + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/install-deps + with: + node-version: ${{ env.NODE_VERSION }} + couchdb-version: ${{ matrix.couchdb }} + - id: test + run: ${{ matrix.cmd }} + continue-on-error: true + - name: First retry + id: retry + if: steps.test.outcome == 'failure' + run: ${{ matrix.cmd }} + continue-on-error: true + - name: Second retry + if: steps.retry.outcome == 'failure' + run: ${{ matrix.cmd }} + + # Run the integration, find and mapreduce tests against all the Node.js + # PouchDB adapters. This should be run for every adapter on every version of + # Node.js we support. + + nodejs-adapter: + needs: lint + strategy: + fail-fast: false + matrix: + node: [14, 16] + adapter: ['leveldb', 'memory'] + cmd: + - npm test + - TYPE=find PLUGINS=pouchdb-find npm test + - TYPE=mapreduce npm test + runs-on: ubuntu-latest + env: + CLIENT: node + ADAPTERS: ${{ matrix.adapter }} + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/install-deps + with: + node-version: ${{ matrix.node }} + - id: test + run: ${{ matrix.cmd }} + continue-on-error: true + - name: First retry + id: retry + if: steps.test.outcome == 'failure' + run: ${{ matrix.cmd }} + continue-on-error: true + - name: Second retry + if: steps.retry.outcome == 'failure' + run: ${{ matrix.cmd }} + + # Run the integration, find and mapreduce tests against all the browser-based + # adapters. PouchDB adapters. This should be run for every adapter on every + # target browser. + + browser-adapter: + needs: lint + strategy: + fail-fast: false + matrix: + client: ['firefox', 'chromium'] + adapter: ['idb', 'indexeddb', 'memory'] + cmd: + - npm test + - TYPE=find PLUGINS=pouchdb-find npm test + - TYPE=mapreduce npm test + runs-on: ubuntu-latest + env: + POUCHDB_SRC: ../../packages/node_modules/pouchdb/dist/pouchdb.min.js + CLIENT: ${{ matrix.client }} + ADAPTERS: ${{ matrix.adapter }} + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/install-deps + with: + node-version: ${{ env.NODE_VERSION }} + - id: test + run: ${{ matrix.cmd }} + continue-on-error: true + - name: First retry + id: retry + if: steps.test.outcome == 'failure' + run: ${{ matrix.cmd }} + continue-on-error: true + - name: Second retry + if: steps.retry.outcome == 'failure' + run: ${{ matrix.cmd }} + + # Run the integration, find and mapreduce tests using pouchdb-server as the + # remote adapter. This checks that pouchdb-server works with the current + # PouchDB source tree. We run this on Node.js and on every target browser. + # Running against different versions of Node.js might require splitting this + # out into a distinct job. + + pouchdb-server: + needs: lint + strategy: + fail-fast: false + matrix: + client: ['node', 'firefox', 'chromium'] + cmd: + - npm test + - TYPE=find PLUGINS=pouchdb-find ADAPTERS=http npm test + - TYPE=mapreduce ADAPTERS=http npm test + runs-on: ubuntu-latest + env: + CLIENT: ${{ matrix.client }} + SERVER: pouchdb-server + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/install-deps + with: + node-version: ${{ env.NODE_VERSION }} + - id: test + run: ${{ matrix.cmd }} + continue-on-error: true + - name: First retry + id: retry + if: steps.test.outcome == 'failure' + run: ${{ matrix.cmd }} + continue-on-error: true + - name: Second retry + if: steps.retry.outcome == 'failure' + run: ${{ matrix.cmd }} + + # Run all the other testing tasks -- unit tests, and so on. These should be + # run on every version of Node.js that we support. + + nodejs: + needs: lint + strategy: + fail-fast: false + matrix: + node: [14, 16] + cmd: + - CLIENT=firefox npm run test-webpack + - AUTO_COMPACTION=true npm test + - PERF=1 npm test + - npm run test-unit + - npm run test-component + - npm run test-fuzzy + # - SERVER=pouchdb-server POUCHDB_SERVER_FLAGS=--in-memory PLUGINS=pouchdb-find npm run report-coverage + - npm run verify-build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/install-deps + with: + node-version: ${{ matrix.node }} + - id: test + run: ${{ matrix.cmd }} + continue-on-error: true + - name: First retry + id: retry + if: steps.test.outcome == 'failure' + run: git reset --hard && ${{ matrix.cmd }} + continue-on-error: true + - name: Second retry + if: steps.retry.outcome == 'failure' + run: git reset --hard && ${{ matrix.cmd }} From 01048b1d168f158b85f9c359253a62ac43f852a9 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Wed, 6 Sep 2023 09:58:46 +0000 Subject: [PATCH 9/9] change paths order --- .github/workflows/docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9ffdbd38b7..1b2fad5f15 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,15 +3,15 @@ name: PouchDB Docs on: push: paths: + - 'package.json' - 'bin/**' - 'docs/**' - - 'package.json' pull_request: branches: [master] paths: + - 'package.json' - 'bin/**' - 'docs/**' - - 'package.json' jobs: