1
0
mirror of https://github.com/nextapps-de/flexsearch.git synced 2025-08-26 07:15:36 +02:00

update github action

This commit is contained in:
Thomas Wilkerling
2025-05-23 19:59:20 +02:00
parent 6a08b5bc2c
commit 57a6f8cf1a
8 changed files with 34 additions and 44 deletions

View File

@@ -60,24 +60,11 @@ jobs:
with: with:
java-version: 21 java-version: 21
- run: npm install - run: npm install
- run: npm install clickhouse - run: npm run build:compact
- run: npm install redis - run: npm run build:module:compact
- run: npm install mongodb - run: npm run build:light
- run: npm install pg-promise - run: npm run build:module:light
- run: npm install sqlite3
- run: npm run build:compact --if-present
- run: npm run build:module:compact --if-present
- run: npm run build:light --if-present
- run: npm run build:module:light --if-present
- run: npm install - run: npm install
working-directory: test working-directory: test
- run: npm run test:github-1 - run: npm run test:github
working-directory: test
- run: npm run test:github-2
working-directory: test
- run: npm run test:github-3
working-directory: test
- run: npm run test:github-4
working-directory: test
- run: npm run test:github-5
working-directory: test working-directory: test

View File

@@ -4,11 +4,7 @@
"scripts": { "scripts": {
"test": "mocha ./*.js --exit", "test": "mocha ./*.js --exit",
"test:ts": "npx tsc --noEmit --lib esnext ./types.ts", "test:ts": "npx tsc --noEmit --lib esnext ./types.ts",
"test:github-1": "npm run test:ts ", "test:github": "npm run test:ts && mocha ./*.js --exit flexsearch.light.min && mocha ./*.js --exit flexsearch.light.module.min && mocha ./*.js --exit flexsearch.compact.min && mocha ./*.js --exit flexsearch.compact.module.min",
"test:github-2": "mocha ./*.js --exit flexsearch.light.min",
"test:github-3": "mocha ./*.js --exit flexsearch.light.module.min",
"test:github-4": "mocha ./*.js --exit flexsearch.compact.min",
"test:github-5": "mocha ./*.js --exit flexsearch.compact.module.min",
"test:coverage": "c8 -c ./.c8rc.json mocha ./*.js --exit", "test:coverage": "c8 -c ./.c8rc.json mocha ./*.js --exit",
"test:keystore": "set NODE_OPTIONS=--max-old-space-size=16000 && c8 -c ./.c8rc.json mocha ./keystore.js --exit", "test:keystore": "set NODE_OPTIONS=--max-old-space-size=16000 && c8 -c ./.c8rc.json mocha ./keystore.js --exit",
"test:db": "c8 -c ./.c8rc.json mocha ./persistent.*.js --exit", "test:db": "c8 -c ./.c8rc.json mocha ./persistent.*.js --exit",

View File

@@ -10,12 +10,10 @@ const build_compact = env && env.includes("compact");
const build_esm = !env || env.startsWith("module"); const build_esm = !env || env.startsWith("module");
const Charset = _Charset || (await import("../src/charset.js")).default; const Charset = _Charset || (await import("../src/charset.js")).default;
import Clickhouse_src from "../src/db/clickhouse/index.js";
import Clickhouse_dist from "../dist/module/db/clickhouse/index.js";
import tests from "./persistent.js"; import tests from "./persistent.js";
if(!build_light && !build_compact){ if(!build_light && !build_compact){
describe("Persistent: Clickhouse", function(){ describe("Persistent: Clickhouse", async function(){
tests(env ? Clickhouse_dist : Clickhouse_src, "Clickhouse"); await tests("Clickhouse");
}); });
} }

View File

@@ -10,7 +10,24 @@ const build_compact = env && env.includes("compact");
const build_esm = !env || env.startsWith("module"); const build_esm = !env || env.startsWith("module");
const Charset = _Charset || (await import("../src/charset.js")).default; const Charset = _Charset || (await import("../src/charset.js")).default;
export default function(DB, DBClass){ export default async function(DBClass){
let DB;
if(DBClass === "Clickhouse"){
DB = (await import(env ? "../dist/module/db/clickhouse/index.js" : "../src/db/clickhouse/index.js")).default;
}
if(DBClass === "Redis"){
DB = (await import(env ? "../dist/module/db/redis/index.js" : "../src/db/redis/index.js")).default;
}
if(DBClass === "Mongo"){
DB = (await import(env ? "../dist/module/db/mongodb/index.js" : "../src/db/mongodb/index.js")).default;
}
if(DBClass === "SQLite"){
DB = (await import(env ? "../dist/module/db/sqlite/index.js" : "../src/db/sqlite/index.js")).default;
}
if(DBClass === "Postgres"){
DB = (await import(env ? "../dist/module/db/postgres/index.js" : "../src/db/postgres/index.js")).default;
}
const data = [{ const data = [{
"tconst": "tt0000001", "tconst": "tt0000001",

View File

@@ -10,12 +10,10 @@ const build_compact = env && env.includes("compact");
const build_esm = !env || env.startsWith("module"); const build_esm = !env || env.startsWith("module");
const Charset = _Charset || (await import("../src/charset.js")).default; const Charset = _Charset || (await import("../src/charset.js")).default;
import Mongo_src from "../src/db/mongodb/index.js";
import Mongo_dist from "../dist/module/db/mongodb/index.js";
import tests from "./persistent.js"; import tests from "./persistent.js";
if(!build_light && !build_compact){ if(!build_light && !build_compact){
describe("Persistent: Mongo", function(){ describe("Persistent: Mongo", async function(){
tests(env ? Mongo_dist : Mongo_src, "Mongo"); await tests("Mongo");
}); });
} }

View File

@@ -10,12 +10,10 @@ const build_compact = env && env.includes("compact");
const build_esm = !env || env.startsWith("module"); const build_esm = !env || env.startsWith("module");
const Charset = _Charset || (await import("../src/charset.js")).default; const Charset = _Charset || (await import("../src/charset.js")).default;
import Postgres_src from "../src/db/postgres/index.js";
import Postgres_dist from "../dist/module/db/postgres/index.js";
import tests from "./persistent.js"; import tests from "./persistent.js";
if(!build_light && !build_compact){ if(!build_light && !build_compact){
describe("Persistent: Postgres", function(){ describe("Persistent: Postgres", async function(){
tests(env ? Postgres_dist : Postgres_src, "Postgres"); await tests("Postgres");
}); });
} }

View File

@@ -10,12 +10,10 @@ const build_compact = env && env.includes("compact");
const build_esm = !env || env.startsWith("module"); const build_esm = !env || env.startsWith("module");
const Charset = _Charset || (await import("../src/charset.js")).default; const Charset = _Charset || (await import("../src/charset.js")).default;
import Redis_src from "../src/db/redis/index.js";
import Redis_dist from "../dist/module/db/redis/index.js";
import tests from "./persistent.js"; import tests from "./persistent.js";
if(!build_light && !build_compact){ if(!build_light && !build_compact){
describe("Persistent: Redis", function(){ describe("Persistent: Redis", async function(){
tests(env ? Redis_dist : Redis_src, "Redis"); await tests("Redis");
}); });
} }

View File

@@ -10,12 +10,10 @@ const build_compact = env && env.includes("compact");
const build_esm = !env || env.startsWith("module"); const build_esm = !env || env.startsWith("module");
const Charset = _Charset || (await import("../src/charset.js")).default; const Charset = _Charset || (await import("../src/charset.js")).default;
import SQLite_src from "../src/db/sqlite/index.js";
import SQLite_dist from "../dist/module/db/sqlite/index.js";
import tests from "./persistent.js"; import tests from "./persistent.js";
if(!build_light && !build_compact){ if(!build_light && !build_compact){
describe("Persistent: SQLite", function(){ describe("Persistent: SQLite", async function(){
tests(env ? SQLite_dist : SQLite_src, "SQLite"); await tests("SQLite");
}); });
} }