Skip to content

Add persisted query cache #27

Add persisted query cache

Add persisted query cache #27

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [master]
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# For a lower total time
# the jobs which take longes must come before the faster ones
# because github will start them likely earlier
jobs:
core:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-core-x8-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-core-x8-
- name: install npm dependencies
run: npm install
- name: build
run: npm run build
- name: test:typings
run: npm run test:typings
# run the node tests for the LokiJS RxStorage
storage-lokijs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-loki-x8-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-loki-x8-
- name: install npm dependencies
run: npm install
- name: build
run: npm run build
- name: npm run test:node:lokijs
run: npm run test:node:lokijs
- name: npm run test:fast:lokijs
run: npm run test:fast:lokijs
- name: npm run test:browser:lokijs
uses: GabrielBB/xvfb-action@v1
with:
run: npm run test:browser:lokijs
- name: performance test
uses: GabrielBB/xvfb-action@v1
with:
run: npm run test:performance:lokijs:browser
- run: npm run test:performance:lokijs:node
storage-memory:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-memory-x8-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-memory-x8-
- name: install npm dependencies
run: npm install
- name: build
run: npm run build
- name: npm run test:node:memory
run: npm run test:node:memory
- name: npm run test:fast:memory
run: npm run test:fast:memory
- name: npm run test:browser:memory
uses: GabrielBB/xvfb-action@v1
with:
run: npm run test:browser:memory
- name: npm run test:fast:memory-validation
run: npm run test:fast:memory-validation
- name: performance test
uses: GabrielBB/xvfb-action@v1
with:
run: npm run test:performance:memory:browser
- run: npm run test:performance:memory:node
- name: node example
working-directory: ./examples/node
run: |
npm install
npm run test
storage-remote:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-remote-x8-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-remote-x8-
- name: install npm dependencies
run: npm install
- name: build
run: npm run build
- run: npm run test:node:remote
- name: npm run test:browser:remote
uses: GabrielBB/xvfb-action@v1
with:
run: npm run test:browser:remote
storage-dexie:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-storage-dexie-x8-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-storage-dexie-x8-
- name: install npm dependencies
run: npm install
- name: build
run: npm run build
- name: npm run test:node:dexie
run: npm run test:node:dexie
- name: npm run test:fast:dexie
run: npm run test:fast:dexie
- name: npm run test:browser:dexie
uses: GabrielBB/xvfb-action@v1
with:
run: npm run test:browser:dexie
- run: npm run test:replication-couchdb
- run: npm run test:replication-firestore
- name: nats replication
# first start/stop the container once to ensure it
# has downloaded the image
run: |
docker pull nats:2.9.17
npm run test:replication-nats
- name: performance test
uses: GabrielBB/xvfb-action@v1
with:
run: npm run test:performance:dexie
storage-foundationdb:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-storage-foundationdb-x8-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-storage-foundationdb-x8-
- name: install FoundationDB client and server
working-directory: ./scripts
run: sh install-foundationdb.sh
- name: install npm dependencies
run: npm install
- run: npm install foundationdb@1.1.3
- name: build
run: npm run build
# Run them twice to ensure no test has persistence
- run: npm run test:node:foundationdb
- run: npm run test:node:foundationdb
- run: npm run test:fast:foundationdb
- run: npm run test:performance:foundationdb
storage-mongodb:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-storage-mongodb-x8-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-storage-mongodb-x8-
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.10.0
with:
mongodb-version: 7.0.1
- name: install npm dependencies
run: npm install
- run: npm run build
- run: node ./config/mongodb-connection-tester.js
- run: npm run test:node:mongodb
- run: npm run test:fast:mongodb
- run: npm run test:performance:mongodb
example-angular:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
#- name: install dependencies
# run: sudo apt-get update && sudo apt-get install -y chromium-browser
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
./examples/angular/node_modules
# invalidate cache when any package.json changes
key: ${{ runner.os }}-npm-angular-x8-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-angular-x8-
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
rm -r node_modules
- name: angular build
working-directory: ./examples/angular
run: |
npm run preinstall
npm install --legacy-peer-deps
npm run lint
npm run build
- name: angular test
# uses: DevExpress/testcafe-action@latest
uses: GabrielBB/xvfb-action@v1.6
with:
working-directory: ./examples/angular
run: npm run test:build
- name: angular test ssr
working-directory: ./examples/angular
run: npm run test:ssr
- name: Capacitor build
working-directory: ./examples/angular
run: npm run build:capacitor
test-builds:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-test-builds-x8-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-test-builds-x8-
- name: prepare RxDB core
run: |
npm install
npm run build
- name: measure build size
run: npm run build:size
- name: test rollup build
run: npm run build:rollup
- run: npm run docs:landingpage:build
test-code-style:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
key: ${{ runner.os }}-npm-test-code-style-x8-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-test-code-style-x8-
- name: prepare RxDB core
run: |
npm install
npm run build
- name: test:deps
run: npm run test:deps
- name: test:circular
run: npm run test:circular
- name: lint
run: npm run lint
- name: check types
run: npm run check-types
- name: spelling readme
uses: codespell-project/actions-codespell@v1.0
with:
ignore_words_file: config/codespellignore.txt
path: README.md
- name: spelling src
uses: codespell-project/actions-codespell@v1.0
with:
ignore_words_file: config/codespellignore.txt
path: src
- name: spelling docs-src
uses: codespell-project/actions-codespell@v1.0
with:
ignore_words_file: config/codespellignore.txt
path: docs-src
- name: spelling docs-src/releases
uses: codespell-project/actions-codespell@v1.0
with:
ignore_words_file: config/codespellignore.txt
path: docs-src/releases
- name: spelling test
uses: codespell-project/actions-codespell@v1.0
with:
ignore_words_file: config/codespellignore.txt
path: test
example-electron:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y chromium-browser
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
- name: electron install
working-directory: ./examples/electron
run: |
npm run preinstall
npm install --legacy-peer-deps
- name: electron test
uses: GabrielBB/xvfb-action@v1.6
with:
working-directory: ./examples/electron
run: npm run test
example-react:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y chromium-browser
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
rm -r node_modules
- name: react install
working-directory: ./examples/react
run: |
npm run preinstall
npm install --legacy-peer-deps
npm run build
- name: react test
uses: GabrielBB/xvfb-action@v1.6
with:
working-directory: ./examples/react
run: npm run test:build
example-react-native-expo:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
# TODO using latest node version does not work with expo-cli https://github.com/expo/expo-cli/issues/4478
node-version: 16.20.1
- name: prepare RxDB core
run: |
npm install
npm run build
rm -r node_modules
- name: react-native
run: |
cd ./examples/react-native
yarn --update-checksums
npx yarn install
yarn test
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
yarn test:bundle
example-supabase:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Reuse npm cache folder
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
./examples/supabase/node_modules
# invalidate cache when any package-lock.json changes
key: ${{ runner.os }}-npm-supabase-x2-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-supabase-x2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-supabase-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
rm -r node_modules
- name: Install
working-directory: ./examples/supabase
run: |
npm run preinstall
npm install --legacy-peer-deps
- name: init supabase docker-compose
working-directory: ./examples/supabase
run: |
sh init-supabase.sh
- name: start supabase
working-directory: ./examples/supabase/supabase/docker
run: docker-compose up -d
- name: import database dump
working-directory: ./examples/supabase
run: sh import-dump.sh
- name: build
working-directory: ./examples/supabase
run: npm run build
- name: test
uses: GabrielBB/xvfb-action@v1.6
with:
working-directory: ./examples/supabase
run: npm run test:dexie
example-vue:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y chromium-browser
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
rm -r node_modules
- name: vue build
working-directory: ./examples/vue
run: |
npm run preinstall
npm install --legacy-peer-deps
npm run lint
npm run build
- name: vue test
uses: GabrielBB/xvfb-action@v1
with:
working-directory: ./examples/vue
run: npm run test
example-svelte:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y chromium-browser
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
rm -r node_modules
- name: svelte build
working-directory: ./examples/svelte
run: |
npm run preinstall
npm install --legacy-peer-deps
npm run build
- name: svelte test
uses: GabrielBB/xvfb-action@v1
with:
working-directory: ./examples/svelte
run: npm run test
vite-vanilla-ts:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y chromium-browser
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
rm -r node_modules
- name: vite vanilla ts build
working-directory: ./examples/vite-vanilla-ts
run: |
npm run preinstall
npm install --legacy-peer-deps
npm run build
- name: vite vanilla ts test
uses: GabrielBB/xvfb-action@v1
with:
working-directory: ./examples/vite-vanilla-ts
run: npm run test
example-graphql:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: install dependencies
run: sudo apt-get update && sudo apt-get install -y chromium-browser
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
- name: install
working-directory: ./examples/graphql
run: |
npm run preinstall
npm install --legacy-peer-deps
- name: build
working-directory: ./examples/graphql
run: npm run build
- name: test test:lokijs
uses: GabrielBB/xvfb-action@v1.6
with:
working-directory: ./examples/graphql
run: npm run test:lokijs
- name: test test:dexie
uses: GabrielBB/xvfb-action@v1.6
with:
working-directory: ./examples/graphql
run: npm run test:dexie
example-flutter:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.3.4"
channel: "stable"
- run: flutter --version
- name: Reuse npm cache folder
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: |
~/.npm
./node_modules
./examples/flutter/javascript/node_modules
key: ${{ runner.os }}-npm-flutter-x9-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-npm-flutter-x9-
- name: prepare RxDB core
run: |
npm install --legacy-peer-deps
npm run build
rm -r node_modules
- name: flutter javascript build
working-directory: ./examples/flutter/javascript
run: |
npm run preinstall
npm install --legacy-peer-deps
npm run build
- name: Add flutter linux dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
- name: flutter test
uses: GabrielBB/xvfb-action@v1.6
with:
working-directory: ./examples/flutter
run: |
flutter config --enable-linux-desktop
flutter test integration_test/basics_test.dart -d linux
test-tutorials:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: prepare RxDB core
run: |
npm install
npm run build
- name: test tutorials
working-directory: ./test/tutorials/
run: |
npm install
npm test
test-multiple-times-lokijs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Set node version
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: prepare RxDB core
run: |
npm install
npm run build
# in the past we had tests that failed randomly
# to prevent this we run the tests in fast-mode 10 times
- name: unit tests 10 times
run: for i in `seq 10`; do npm run test:fast:lokijs; done
# I found out that people are stupid and use the npm downloads count
# to measure the quality of an open source project.
# But this is a bad metric so I destroy it by obfuscating the actual download count.
# This should never increase the total time of the CI. If this task takes longer then all other tasks,
# decrease the download calls.
# download:
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v2
# - name: Set node version
# uses: actions/setup-node@v3
# with:
# node-version-file: '.nvmrc'
# - name: download X times
# run: |
# npm i rxdb --no-optional --skip-installed --ignore-scripts --no-audit
# npm cache clean --force
# rm -rf node_modules
# npm i rxdb --no-optional --skip-installed --ignore-scripts --no-audit
# npm cache clean --force
# rm -rf node_modules
# npm i rxdb --no-optional --skip-installed --ignore-scripts --no-audit
# npm cache clean --force
# rm -rf node_modules
# npm i rxdb --no-optional --skip-installed --ignore-scripts --no-audit
# npm cache clean --force
# rm -rf node_modules
# npm i rxdb --no-optional --skip-installed --ignore-scripts --no-audit