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
|
runs-on: ubuntu-latest
|
||||||
container: node:${{ matrix.node_version }}
|
container: node:${{ matrix.node_version }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- name: Use Node.js ${{ matrix.node_version }}
|
- name: Use Node.js ${{ matrix.node_version }}
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node_version }}
|
node-version: ${{ matrix.node_version }}
|
||||||
cache: 'yarn'
|
- name: Get yarn cache directory path
|
||||||
- run: yarn install
|
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
|
- 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:
|
env:
|
||||||
LOGGER_LEVEL: error
|
LOGGER_LEVEL: error
|
||||||
DB_DIALECT: sqlite
|
DB_DIALECT: sqlite
|
||||||
@ -72,17 +84,27 @@ jobs:
|
|||||||
--health-timeout 5s
|
--health-timeout 5s
|
||||||
--health-retries 5
|
--health-retries 5
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- name: Use Node.js ${{ matrix.node_version }}
|
- name: Use Node.js ${{ matrix.node_version }}
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node_version }}
|
node-version: ${{ matrix.node_version }}
|
||||||
cache: 'yarn'
|
- name: Get yarn cache directory path
|
||||||
- run: yarn install
|
id: yarn-cache-dir-path
|
||||||
# - run: yarn build
|
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
|
- name: Test with postgres
|
||||||
run: |
|
run: |
|
||||||
yarn nocobase install -f
|
|
||||||
./node_modules/.bin/tsx packages/core/test/src/scripts/test-db-creator.ts &
|
./node_modules/.bin/tsx packages/core/test/src/scripts/test-db-creator.ts &
|
||||||
sleep 1
|
sleep 1
|
||||||
node --max_old_space_size=4096 ./node_modules/.bin/jest --maxWorkers=100% --workerIdleMemoryLimit=3000MB
|
node --max_old_space_size=4096 ./node_modules/.bin/jest --maxWorkers=100% --workerIdleMemoryLimit=3000MB
|
||||||
@ -116,17 +138,26 @@ jobs:
|
|||||||
MYSQL_DATABASE: nocobase
|
MYSQL_DATABASE: nocobase
|
||||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
- name: Use Node.js ${{ matrix.node_version }}
|
- name: Use Node.js ${{ matrix.node_version }}
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node_version }}
|
node-version: ${{ matrix.node_version }}
|
||||||
cache: 'yarn'
|
- name: Get yarn cache directory path
|
||||||
- run: yarn install
|
id: yarn-cache-dir-path
|
||||||
# - run: yarn build
|
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
|
- name: Test with MySQL
|
||||||
run: |
|
run: |
|
||||||
yarn nocobase install -f
|
|
||||||
./node_modules/.bin/tsx packages/core/test/src/scripts/test-db-creator.ts &
|
./node_modules/.bin/tsx packages/core/test/src/scripts/test-db-creator.ts &
|
||||||
sleep 1
|
sleep 1
|
||||||
node --max_old_space_size=4096 ./node_modules/.bin/jest --maxWorkers=100% --workerIdleMemoryLimit=3000MB
|
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();
|
this._client = await this._createConnection();
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`Creating database: ${name}`);
|
|
||||||
await this._createDB(name);
|
await this._createDB(name);
|
||||||
this.createdDBs.add(name);
|
this.createdDBs.add(name);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user