Browse Source

refactor: update actions and other scripts

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5569/head
Pranav C 2 years ago
parent
commit
1128e01193
  1. 10
      .github/workflows/ci-cd.yml
  2. 10
      .github/workflows/playwright-test-workflow.yml
  3. 4
      packages/nocodb/package-lock.json
  4. 2
      tests/playwright/setup/db.ts

10
.github/workflows/ci-cd.yml

@ -9,7 +9,6 @@ on:
paths:
- "packages/nc-gui/**"
- "packages/nocodb/**"
- "packages/nocodb-nest/**"
- ".github/workflows/ci-cd.yml"
- "tests/playwright/**"
pull_request:
@ -18,7 +17,6 @@ on:
paths:
- "packages/nc-gui/**"
- "packages/nocodb/**"
- "packages/nocodb-nest/**"
- ".github/workflows/ci-cd.yml"
- "tests/playwright/**"
@ -60,10 +58,10 @@ jobs:
working-directory: ./packages/nocodb-sdk
run: npm run build:main
- name: Install dependencies
working-directory: ./packages/nocodb-nest
working-directory: ./packages/nocodb
run: npm install
- name: run unit tests
working-directory: ./packages/nocodb-nest
working-directory: ./packages/nocodb
run: npm run test:unit
unit-tests-pg:
runs-on: ubuntu-20.04
@ -101,10 +99,10 @@ jobs:
working-directory: ./packages/nocodb-sdk
run: npm run build:main
- name: Install dependencies
working-directory: ./packages/nocodb-nest
working-directory: ./packages/nocodb
run: npm install
- name: run unit tests
working-directory: ./packages/nocodb-nest
working-directory: ./packages/nocodb
run: npm run test:unit:pg
playwright-mysql-1:
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}

10
.github/workflows/playwright-test-workflow.yml

@ -69,7 +69,7 @@ jobs:
working-directory: ./packages/nc-gui
run: npm run ci:run
- name: Run backend
working-directory: ./packages/nocodb-nest
working-directory: ./packages/nocodb
run: |
npm install
npm run watch:run:playwright > ${{ inputs.db }}_${{ inputs.shard }}_test_backend.log &
@ -109,13 +109,13 @@ jobs:
# Quick tests (pg on sqlite shard 0 and sqlite on sqlite shard 1)
- name: Run quick server and tests (pg)
if: ${{ inputs.db == 'sqlite' && inputs.shard == '1' }}
working-directory: ./packages/nocodb-nest
working-directory: ./packages/nocodb
run: |
kill -9 $(lsof -t -i:8080)
npm run watch:run:playwright:pg:cyquick &
- name: Run quick server and tests (sqlite)
if: ${{ inputs.db == 'sqlite' && inputs.shard == '2' }}
working-directory: ./packages/nocodb-nest
working-directory: ./packages/nocodb
run: |
kill -9 $(lsof -t -i:8080)
npm run watch:run:playwright:quick > quick_${{ inputs.shard }}_test_backend.log &
@ -132,7 +132,7 @@ jobs:
if: ${{ inputs.db == 'sqlite' }}
with:
name: quick-backend-log-${{ inputs.shard }}
path: ./packages/nocodb-nest/quick_${{ inputs.shard }}_test_backend.log
path: ./packages/nocodb/quick_${{ inputs.shard }}_test_backend.log
retention-days: 2
- uses: actions/upload-artifact@v3
if: ${{ inputs.db == 'sqlite' }}
@ -157,5 +157,5 @@ jobs:
if: always()
with:
name: backend-logs-${{ inputs.db }}-${{ inputs.shard }}
path: ./packages/nocodb-nest/${{ inputs.db }}_${{ inputs.shard }}_test_backend.log
path: ./packages/nocodb/${{ inputs.db }}_${{ inputs.shard }}_test_backend.log
retention-days: 2

4
packages/nocodb/package-lock.json generated

@ -1,11 +1,11 @@
{
"name": "nocodb-nest",
"name": "nocodb",
"version": "0.0.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "nocodb-nest",
"name": "nocodb",
"version": "0.0.1",
"license": "AGPL-3.0-or-later",
"dependencies": {

2
tests/playwright/setup/db.ts

@ -55,7 +55,7 @@ const mysqlExec = async query => {
async function sqliteExec(query) {
const parallelIndex = process.env.TEST_PARALLEL_INDEX;
const rootProjectDir = __dirname.replace('/tests/playwright/setup', '');
await sqliteDb.open(`${rootProjectDir}/packages/nocodb-nest/test_sakila_${parallelIndex}.db`);
await sqliteDb.open(`${rootProjectDir}/packages/nocodb/test_sakila_${parallelIndex}.db`);
await sqliteDb.run(query);
await sqliteDb.close();

Loading…
Cancel
Save