2023-06-09 09:23:04 +08:00
|
|
|
name: NocoBase Backend Test
|
2022-01-08 17:16:11 +08:00
|
|
|
|
2022-09-19 09:23:01 +08:00
|
|
|
on:
|
2022-09-27 22:50:10 +08:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- develop
|
2022-10-28 11:41:48 +08:00
|
|
|
paths:
|
2023-03-30 18:27:38 +08:00
|
|
|
- 'packages/core/acl/**'
|
|
|
|
- 'packages/core/actions/**'
|
|
|
|
- 'packages/core/database/**'
|
|
|
|
- 'packages/core/server/**'
|
|
|
|
- 'packages/plugins/**/src/server/**'
|
2023-06-09 09:23:04 +08:00
|
|
|
- '.github/workflows/nocobase-test-backend.yml'
|
2022-09-19 09:23:01 +08:00
|
|
|
pull_request:
|
2022-10-28 11:41:48 +08:00
|
|
|
paths:
|
2023-03-30 18:27:38 +08:00
|
|
|
- 'packages/core/acl/**'
|
|
|
|
- 'packages/core/actions/**'
|
|
|
|
- 'packages/core/database/**'
|
|
|
|
- 'packages/core/server/**'
|
|
|
|
- 'packages/plugins/**/src/server/**'
|
2023-06-09 09:23:04 +08:00
|
|
|
- '.github/workflows/nocobase-test-backend.yml'
|
2022-01-08 17:16:11 +08:00
|
|
|
|
|
|
|
jobs:
|
2023-02-22 12:05:59 +08:00
|
|
|
sqlite-test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-07-14 14:49:12 +08:00
|
|
|
node_version: ['18']
|
|
|
|
underscored: [true, false]
|
2023-02-22 12:05:59 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: node:${{ matrix.node_version }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js ${{ matrix.node_version }}
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node_version }}
|
|
|
|
cache: 'yarn'
|
|
|
|
- run: yarn install
|
2022-10-28 11:41:48 +08:00
|
|
|
- name: Test with Sqlite
|
2023-07-27 09:17:08 +08:00
|
|
|
run: yarn nocobase install -f && node --max_old_space_size=4096 ./node_modules/.bin/jest --maxWorkers=1 --workerIdleMemoryLimit=3000MB
|
2022-10-28 11:41:48 +08:00
|
|
|
env:
|
2023-07-27 21:57:13 +08:00
|
|
|
LOGGER_LEVEL: error
|
2022-10-28 11:41:48 +08:00
|
|
|
DB_DIALECT: sqlite
|
|
|
|
DB_STORAGE: /tmp/db.sqlite
|
2023-02-16 10:53:04 +08:00
|
|
|
DB_UNDERSCORED: ${{ matrix.underscored }}
|
2023-08-24 17:47:45 +08:00
|
|
|
timeout-minutes: 40
|
2022-10-28 11:41:48 +08:00
|
|
|
|
|
|
|
postgres-test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-07-14 14:49:12 +08:00
|
|
|
node_version: ['18']
|
|
|
|
underscored: [true, false]
|
|
|
|
schema: [public, nocobase]
|
|
|
|
collection_schema: [public, user_schema]
|
2022-01-08 17:16:11 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: node:${{ matrix.node_version }}
|
|
|
|
services:
|
|
|
|
# Label used to access the service container
|
|
|
|
postgres:
|
|
|
|
# Docker Hub image
|
2023-07-14 14:49:12 +08:00
|
|
|
image: postgres:11
|
2022-01-08 17:16:11 +08:00
|
|
|
# Provide the password for postgres
|
|
|
|
env:
|
|
|
|
POSTGRES_USER: nocobase
|
|
|
|
POSTGRES_PASSWORD: password
|
|
|
|
# Set health checks to wait until postgres has started
|
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js ${{ matrix.node_version }}
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node_version }}
|
|
|
|
cache: 'yarn'
|
|
|
|
- run: yarn install
|
2023-02-22 12:05:59 +08:00
|
|
|
# - run: yarn build
|
2022-01-08 17:16:11 +08:00
|
|
|
- name: Test with postgres
|
2023-07-27 09:17:08 +08:00
|
|
|
run: yarn nocobase install -f && node --max_old_space_size=4096 ./node_modules/.bin/jest --maxWorkers=1 --workerIdleMemoryLimit=3000MB
|
2022-01-08 17:16:11 +08:00
|
|
|
env:
|
2023-07-27 21:57:13 +08:00
|
|
|
LOGGER_LEVEL: error
|
2022-01-08 17:16:11 +08:00
|
|
|
DB_DIALECT: postgres
|
|
|
|
DB_HOST: postgres
|
|
|
|
DB_PORT: 5432
|
|
|
|
DB_USER: nocobase
|
|
|
|
DB_PASSWORD: password
|
|
|
|
DB_DATABASE: nocobase
|
2023-02-16 10:53:04 +08:00
|
|
|
DB_UNDERSCORED: ${{ matrix.underscored }}
|
|
|
|
DB_SCHEMA: ${{ matrix.schema }}
|
2023-03-05 14:45:56 +08:00
|
|
|
COLLECTION_MANAGER_SCHEMA: ${{ matrix.collection_schema }}
|
2023-08-24 17:47:45 +08:00
|
|
|
timeout-minutes: 40
|
2022-10-28 11:41:48 +08:00
|
|
|
|
|
|
|
mysql-test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-07-14 14:49:12 +08:00
|
|
|
node_version: ['18']
|
|
|
|
underscored: [true, false]
|
2022-10-28 11:41:48 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: node:${{ matrix.node_version }}
|
|
|
|
services:
|
|
|
|
mysql:
|
|
|
|
image: mysql:8
|
2022-01-08 17:16:11 +08:00
|
|
|
env:
|
2022-10-28 11:41:48 +08:00
|
|
|
MYSQL_ROOT_PASSWORD: password
|
|
|
|
MYSQL_DATABASE: nocobase
|
|
|
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js ${{ matrix.node_version }}
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node_version }}
|
|
|
|
cache: 'yarn'
|
|
|
|
- run: yarn install
|
2023-02-22 12:05:59 +08:00
|
|
|
# - run: yarn build
|
2022-01-08 17:16:11 +08:00
|
|
|
- name: Test with MySQL
|
2023-07-27 09:17:08 +08:00
|
|
|
run: yarn nocobase install -f && node --max_old_space_size=4096 ./node_modules/.bin/jest --maxWorkers=1 --workerIdleMemoryLimit=3000MB
|
2022-01-08 17:16:11 +08:00
|
|
|
env:
|
2023-07-27 21:57:13 +08:00
|
|
|
LOGGER_LEVEL: error
|
2022-01-08 17:16:11 +08:00
|
|
|
DB_DIALECT: mysql
|
|
|
|
DB_HOST: mysql
|
|
|
|
DB_PORT: 3306
|
|
|
|
DB_USER: root
|
|
|
|
DB_PASSWORD: password
|
|
|
|
DB_DATABASE: nocobase
|
2023-02-16 10:53:04 +08:00
|
|
|
DB_UNDERSCORED: ${{ matrix.underscored }}
|
2023-08-24 17:47:45 +08:00
|
|
|
timeout-minutes: 40
|