mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 05:46:00 +00:00
chore: ci yarn cache (#2853)
* chore: github action setup node * chore: github action * chore: yarn install options * chore: action cache * fix: yml * chore: workflow yaml * chore: workflow yaml * chore: db creator log
This commit is contained in:
parent
02559b61ba
commit
a4cccb4032
65
.github/workflows/nocobase-test-backend.yml
vendored
65
.github/workflows/nocobase-test-backend.yml
vendored
@ -30,15 +30,27 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
container: node:${{ matrix.node_version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Node.js ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
cache: 'yarn'
|
||||
- run: yarn install
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- uses: actions/cache@v3
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Install project dependencies
|
||||
run: yarn --prefer-offline
|
||||
- name: Test with Sqlite
|
||||
run: yarn nocobase install -f && node --max_old_space_size=4096 ./node_modules/.bin/jest --maxWorkers=100% --workerIdleMemoryLimit=3000MB
|
||||
run: node --max_old_space_size=4096 ./node_modules/.bin/jest --maxWorkers=100% --workerIdleMemoryLimit=3000MB
|
||||
env:
|
||||
LOGGER_LEVEL: error
|
||||
DB_DIALECT: sqlite
|
||||
@ -72,17 +84,27 @@ jobs:
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Node.js ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
cache: 'yarn'
|
||||
- run: yarn install
|
||||
# - run: yarn build
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- uses: actions/cache@v3
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Install project dependencies
|
||||
run: yarn --prefer-offline
|
||||
- name: Test with postgres
|
||||
run: |
|
||||
yarn nocobase install -f
|
||||
./node_modules/.bin/tsx packages/core/test/src/scripts/test-db-creator.ts &
|
||||
sleep 1
|
||||
node --max_old_space_size=4096 ./node_modules/.bin/jest --maxWorkers=100% --workerIdleMemoryLimit=3000MB
|
||||
@ -116,17 +138,26 @@ jobs:
|
||||
MYSQL_DATABASE: nocobase
|
||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Use Node.js ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
cache: 'yarn'
|
||||
- run: yarn install
|
||||
# - run: yarn build
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
|
||||
- uses: actions/cache@v3
|
||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
- name: Install project dependencies
|
||||
run: yarn --prefer-offline
|
||||
- name: Test with MySQL
|
||||
run: |
|
||||
yarn nocobase install -f
|
||||
./node_modules/.bin/tsx packages/core/test/src/scripts/test-db-creator.ts &
|
||||
sleep 1
|
||||
node --max_old_space_size=4096 ./node_modules/.bin/jest --maxWorkers=100% --workerIdleMemoryLimit=3000MB
|
||||
|
@ -24,7 +24,6 @@ abstract class BaseClient<Client> {
|
||||
this._client = await this._createConnection();
|
||||
}
|
||||
|
||||
console.log(`Creating database: ${name}`);
|
||||
await this._createDB(name);
|
||||
this.createdDBs.add(name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user