π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
chore: migrate to ubicloud runners
mertmita8ab6dbe624c
diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.ymlindex 853a6056df..0c87ab115d 100644--- a/.github/workflows/ci-cd.yml+++ b/.github/workflows/ci-cd.yml@@ -144,11 +144,13 @@ jobs:pre-build-for-playwright:uses: ./.github/workflows/pre-build-for-playwright.yml+ secrets: inheritplaywright-mysql-1:needs: pre-build-for-playwrightif: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}uses: ./.github/workflows/playwright-test-workflow.yml+ secrets: inheritwith:db: mysqlshard: 1@@ -156,6 +158,7 @@ jobs:needs: pre-build-for-playwrightif: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}uses: ./.github/workflows/playwright-test-workflow.yml+ secrets: inheritwith:db: mysqlshard: 2@@ -163,6 +166,7 @@ jobs:needs: pre-build-for-playwrightif: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}uses: ./.github/workflows/playwright-test-workflow.yml+ secrets: inheritwith:db: mysqlshard: 3@@ -170,6 +174,7 @@ jobs:needs: pre-build-for-playwrightif: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}uses: ./.github/workflows/playwright-test-workflow.yml+ secrets: inheritwith:db: mysqlshard: 4@@ -177,6 +182,7 @@ jobs:needs: pre-build-for-playwrightif: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}uses: ./.github/workflows/playwright-test-workflow.yml+ secrets: inheritwith:db: sqliteshard: 1@@ -184,6 +190,7 @@ jobs:needs: pre-build-for-playwrightif: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}uses: ./.github/workflows/playwright-test-workflow.yml+ secrets: inheritwith:db: sqliteshard: 2@@ -191,6 +198,7 @@ jobs:needs: pre-build-for-playwrightif: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}uses: ./.github/workflows/playwright-test-workflow.yml+ secrets: inheritwith:db: sqliteshard: 3@@ -198,6 +206,7 @@ jobs:needs: pre-build-for-playwrightif: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}uses: ./.github/workflows/playwright-test-workflow.yml+ secrets: inheritwith:db: sqliteshard: 4@@ -205,6 +214,7 @@ jobs:needs: pre-build-for-playwrightif: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}uses: ./.github/workflows/playwright-test-workflow.yml+ secrets: inheritwith:db: pgshard: 1@@ -212,6 +222,7 @@ jobs:needs: pre-build-for-playwrightif: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}uses: ./.github/workflows/playwright-test-workflow.yml+ secrets: inheritwith:db: pgshard: 2@@ -219,6 +230,7 @@ jobs:needs: pre-build-for-playwrightif: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}uses: ./.github/workflows/playwright-test-workflow.yml+ secrets: inheritwith:db: pgshard: 3@@ -226,6 +238,7 @@ jobs:needs: pre-build-for-playwrightif: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft }}uses: ./.github/workflows/playwright-test-workflow.yml+ secrets: inheritwith:db: pgshard: 4diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.ymlindex ea7b82503f..23c58436af 100644--- a/.github/workflows/dependency-review.yml+++ b/.github/workflows/dependency-review.yml@@ -17,7 +17,7 @@ permissions:jobs:dependency-review:- runs-on: [self-hosted, v3, aws]+ runs-on: ubicloud-standard-2steps:- name: Checkout codeuses: actions/checkout@v4diff --git a/.github/workflows/jest-unit-test.yml b/.github/workflows/jest-unit-test.ymlindex c67c9489eb..874d95dba0 100644--- a/.github/workflows/jest-unit-test.yml+++ b/.github/workflows/jest-unit-test.yml@@ -16,34 +16,23 @@ on:workflow_dispatch:jobs:jest-unit-test:- runs-on: [self-hosted, aws]+ runs-on: ubicloud-standard-4timeout-minutes: 20if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'trigger-CI') || !github.event.pull_request.draft || inputs.force == true }}steps:- name: Checkout- uses: actions/checkout@v3+ uses: actions/checkout@v4with:fetch-depth: 0- - name: Setup Node- uses: actions/setup-node@v3- with:- node-version: 22.12.0- name: Setup pnpmuses: pnpm/action-setup@v4with:version: 9- - name: Get pnpm store directory- shell: bash- timeout-minutes: 1- run: |- echo "STORE_PATH=/root/setup-pnpm/node_modules/.bin/store/v3" >> $GITHUB_ENV- - uses: actions/cache@v3- name: Setup pnpm cache+ - name: Setup Node+ uses: actions/setup-node@v4with:- path: ${{ env.STORE_PATH }}- key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}- restore-keys: |- ${{ runner.os }}-pnpm-store-+ node-version: 22.12.0+ cache: 'pnpm'- name: Set CI envrun: export CI=true- name: Set NC Editiondiff --git a/.github/workflows/playwright-test-workflow.yml b/.github/workflows/playwright-test-workflow.ymlindex e35ccddb91..abd1b66aa5 100644--- a/.github/workflows/playwright-test-workflow.yml+++ b/.github/workflows/playwright-test-workflow.yml@@ -13,46 +13,46 @@ on:jobs:playwright:- runs-on: [self-hosted, v3]+ runs-on: ubicloud-standard-8timeout-minutes: 100+ services:+ postgres:+ image: postgres:17+ env:+ POSTGRES_PASSWORD: password+ POSTGRES_USER: postgres+ ports:+ - 5432:5432+ options: >-+ --health-cmd pg_isready+ --health-interval 10s+ --health-timeout 5s+ --health-retries 5+ mysql:+ image: mysql:8+ env:+ MYSQL_ROOT_PASSWORD: password+ ports:+ - 3306:3306+ options: >-+ --health-cmd "mysqladmin ping"+ --health-interval 10s+ --health-timeout 5s+ --health-retries 5steps:- name: Checkout- uses: actions/checkout@v3+ uses: actions/checkout@v4- name: remove use-node-version from .npmrcrun: sed -i '/^use-node-version/d' .npmrc- - name: Setup Node- uses: actions/setup-node@v3- with:- node-version: 22.12.0- name: Setup pnpmuses: pnpm/action-setup@v4with:version: 9- - name: Get pnpm store directory- shell: bash- run: |- echo "STORE_PATH=/root/setup-pnpm/node_modules/.bin/store/v3" >> $GITHUB_ENV- - uses: actions/cache@v3- name: Setup pnpm cache+ - name: Setup Node+ uses: actions/setup-node@v4with:- path: ${{ env.STORE_PATH }}- key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}- restore-keys: |- ${{ runner.os }}-pnpm-store-- - name: setup pg- if: ${{ inputs.db == 'pg' || ( inputs.db == 'sqlite' && inputs.shard == '1' ) }}- working-directory: ./- run: |- service postgresql start- cd /var/lib/postgresql/ && sudo -u postgres psql -c "SELECT 'dropdb '||datname||'' FROM pg_database WHERE datistemplate = false AND datallowconn = true And datname NOT IN ('postgres')" |grep ' dropdb ' | sudo -u postgres /bin/bash ; cd- sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'password';"- sudo -u postgres psql -c "ALTER USER postgres WITH SUPERUSER;"- service postgresql restart- - name: Kill stale servers- run: |- # export NODE_OPTIONS=\"--max_old_space_size=16384\";- kill -9 $(lsof -t -i:8080) || echo "no process running on 8080"- kill -9 $(lsof -t -i:3000) || echo "no process running on 3000"+ node-version: 22.12.0+ cache: 'pnpm'- name: Set CI envrun: export CI=true- name: Set NC Edition@@ -63,16 +63,15 @@ jobs:if: ${{ inputs.db == 'mysql' }}working-directory: ./packages/nocodb/tests/mysql-sakila-dbrun: |- # Get a list of non-system databases and construct the DROP DATABASE statement for each- service mysql start- mysql -u'root' -p'password' -e "SHOW DATABASES" --skip-column-names | grep -Ev "(information_schema|mysql|performance_schema|sys)" | while read db; do- mysql -u'root' -p'password' -e "DROP DATABASE IF EXISTS \`$db\`";+ # Get a list of non-system databases and drop them+ MYSQL_PWD=password mysql -h 127.0.0.1 -u'root' -e "SHOW DATABASES" --skip-column-names | grep -Ev "(information_schema|mysql|performance_schema|sys)" | while read db; do+ MYSQL_PWD=password mysql -h 127.0.0.1 -u'root' -e "DROP DATABASE IF EXISTS \`$db\`";done# keep sql_mode default except remove "STRICT_TRANS_TABLES"- mysql -u'root' -p'password' -e "SET GLOBAL sql_mode = 'ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';"- # this is only needed for connecting to sakila db as its refeferred in multiple places in test code- mysql -u'root' -p'password' < 01-mysql-sakila-schema.sql- mysql -u'root' -p'password' < 02-mysql-sakila-insert-data.sql+ MYSQL_PWD=password mysql -h 127.0.0.1 -u'root' -e "SET GLOBAL sql_mode = 'ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';"+ # this is only needed for connecting to sakila db as its referred in multiple places in test code+ MYSQL_PWD=password mysql -h 127.0.0.1 -u'root' < 01-mysql-sakila-schema.sql+ MYSQL_PWD=password mysql -h 127.0.0.1 -u'root' < 02-mysql-sakila-insert-data.sql- name: Run backendif: ${{ inputs.db == 'sqlite' }}working-directory: ./packages/nocodb@@ -88,29 +87,33 @@ jobs:working-directory: ./packages/nocodbrun: |pnpm run watch:run:playwright:pg &> ${{ inputs.db }}_${{ inputs.shard }}_test_backend.log &- - name: download ui build from artf server++ - name: Configure AWS credentials for UI download+ uses: aws-actions/configure-aws-credentials@v4+ with:+ aws-access-key-id: ${{ secrets.ARTIFACTS_S3_ACCESS_KEY }}+ aws-secret-access-key: ${{ secrets.ARTIFACTS_S3_SECRET_KEY }}+ aws-region: us-east-2++ - name: Download pre-built UI from S3working-directory: ./packages/nc-gui/run: |- # expects the variables to be available in runner context.rm -rf .output.zip .outputFILE="$(echo ${GITHUB_REPOSITORY} | sed "s,/,-,g")-${GITHUB_RUN_ID}.zip"- BUILD_FILE_URL=http://65.21.27.147/gh-artifacts/ui-builds/${FILE}- time curl -o output.zip ${BUILD_FILE_URL} -n- unzip -oq output.zip+ aws s3 cp s3://nocohub-ci-artifacts/ui-builds/${FILE} ./output.zip+ unzip -oq output.zip- # path="gh-artifacts/runs/${GITHUB_RUN_ID}/ui-build/.output"- # target_dir="/mnt/${path}"- # if [[ -d ${target_dir} ]]; then- # echo "Directory ${target_dir} exists."- # cp -r ${target_dir} . || echo "playwright reports directory does not exists" >> ${target_dir}/playwright-report/index.html- # else- # echo "Error: Directory ${target_dir} does not exists."- # exit 1- # fi- name: start frontendworking-directory: ./packages/nc-gui/run: |pnpm run ci:start+ - name: Cache Playwright browsers+ uses: actions/cache@v4+ with:+ path: ~/.cache/ms-playwright+ key: ${{ runner.os }}-playwright-${{ hashFiles('tests/playwright/package.json') }}+ restore-keys: |+ ${{ runner.os }}-playwright-- name: Install Playwright Browsersworking-directory: ./tests/playwrightrun: pnpm exec playwright install --with-deps chromium@@ -124,7 +127,7 @@ jobs:while ! curl --output /dev/null --silent --head --fail http://localhost:8080; doprintf '.'sleep 2- done+ doneecho "Backend is up"timeout-minutes: 5- name: Run Playwright Tests@@ -139,33 +142,6 @@ jobs:working-directory: ./tests/playwrightrun: E2E_DB_TYPE=${{ inputs.db }} node ./scripts/stressTestNewlyAddedTest.js- # # 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- # run: |- # kill -9 $(lsof -t -i:8080)- # npm run watch:run:playwright:pg:cyquick > quick_${{ inputs.shard }}_test_backend.log &- # - name: Run quick server and tests (sqlite)- # if: ${{ inputs.db == 'sqlite' && inputs.shard == '2' }}- # working-directory: ./packages/nocodb- # run: |- # kill -9 $(lsof -t -i:8080)- # npm run watch:run:playwright:quick > quick_${{ inputs.shard }}_test_backend.log &- # - name: Wait for backend for sqlite-tests- # if: ${{ inputs.db == 'sqlite' }}- # working-directory: ./tests/playwright- # run: |- # while ! curl --output /dev/null --silent --head --fail http://localhost:8080; do- # printf '.'- # sleep 2- # done- # timeout-minutes: 1- # - name: Run quick tests- # if: ${{ inputs.db == 'sqlite' }}- # working-directory: ./tests/playwright- # run: PLAYWRIGHT_HTML_REPORT=playwright-report-quick npm run test:quick-- uses: actions/upload-artifact@v4if: ${{ inputs.db == 'sqlite' }}with:@@ -197,25 +173,34 @@ jobs:name: backend-logs-${{ inputs.db }}-${{ inputs.shard }}path: ./packages/nocodb/${{ inputs.db }}_${{ inputs.shard }}_test_backend.logretention-days: 2- - name: stop database servers++ - name: Configure AWS credentials for artifact uploadif: always()- working-directory: ./packages/nocodb- run: |- service postgresql stop- service mysql stop- - name: Copy Artifacts to Local Artifacts Dir+ uses: aws-actions/configure-aws-credentials@v4+ with:+ aws-access-key-id: ${{ secrets.ARTIFACTS_S3_ACCESS_KEY }}+ aws-secret-access-key: ${{ secrets.ARTIFACTS_S3_SECRET_KEY }}+ aws-region: us-east-2++ - name: Upload Artifacts to S3if: always()working-directory: ./run: |- # expects the variables to be available in runner context.- path="gh-artifacts/runs/${GITHUB_RUN_ID}/run-attempt/${GITHUB_RUN_ATTEMPT}/job_name/"${GITHUB_JOB}"-${{ inputs.shard }}/${RANDOM}-$(date +%s)"- target_dir="/mnt/${path}"- mkdir -p ${target_dir}- mkdir -p ${target_dir}/playwright-report- # start : add any artifacts to be copied here- cp -r ./tests/playwright/playwright-report ${target_dir}/ || echo "playwright reports directory does not exists" >> ${target_dir}/playwright-report/index.html- cp ./packages/nocodb/*_test_backend.log ${target_dir}/ || echo "backend logs file does not exists" >> ${target_dir}/index.html- # end: artifacts copy- SUMMARY='[Artifacts]('${REPORTS_HOST:-http://135.181.48.96}/${path}')- [playwright-report]('${REPORTS_HOST:-http://135.181.48.96}/${path}'/playwright-report)'+ s3_path="runs/${GITHUB_RUN_ID}/run-attempt/${GITHUB_RUN_ATTEMPT}/job_name/${GITHUB_JOB}-${{ inputs.shard }}/${RANDOM}-$(date +%s)"++ # Upload playwright reports if they exist+ if [ -d "./tests/playwright/playwright-report" ]; then+ aws s3 sync ./tests/playwright/playwright-report s3://nocohub-ci-artifacts/${s3_path}/playwright-report/+ else+ echo "playwright reports directory does not exist" | aws s3 cp - s3://nocohub-ci-artifacts/${s3_path}/playwright-report/index.html+ fi++ # Upload backend logs if they exist (as text/plain so they render in browser)+ LOG_FILE="${{ inputs.db }}_${{ inputs.shard }}_test_backend.log"+ if [ -f "./packages/nocodb/${LOG_FILE}" ]; then+ aws s3 cp ./packages/nocodb/${LOG_FILE} s3://nocohub-ci-artifacts/${s3_path}/${LOG_FILE} --content-type "text/plain; charset=utf-8"+ fi++ SUMMARY="[backend-logs](https://nocohub-ci-artifacts.s3.us-east-2.amazonaws.com/${s3_path}/${LOG_FILE})+ [playwright-report](https://nocohub-ci-artifacts.s3.us-east-2.amazonaws.com/${s3_path}/playwright-report/index.html)"echo "$SUMMARY" >> $GITHUB_STEP_SUMMARYdiff --git a/.github/workflows/pre-build-for-playwright.yml b/.github/workflows/pre-build-for-playwright.ymlindex 55f3ec9bd9..e20d3045c8 100644--- a/.github/workflows/pre-build-for-playwright.yml+++ b/.github/workflows/pre-build-for-playwright.yml@@ -5,32 +5,22 @@ on:jobs:playwright:- runs-on: [self-hosted, v3]+ runs-on: ubicloud-standard-8timeout-minutes: 100steps:- name: Checkout- uses: actions/checkout@v3- - name: Setup Node- uses: actions/setup-node@v3- with:- node-version: 22.12.0+ uses: actions/checkout@v4- name: Setup pnpmuses: pnpm/action-setup@v4with:version: 9+ - name: Setup Node+ uses: actions/setup-node@v4+ with:+ node-version: 22.12.0+ cache: 'pnpm'- name: remove use-node-version from .npmrcrun: sed -i '/^use-node-version/d' .npmrc- - name: Get pnpm store directory- shell: bash- run: |- echo "STORE_PATH=/root/setup-pnpm/node_modules/.bin/store/v3" >> $GITHUB_ENV- - uses: actions/cache@v3- name: Setup pnpm cache- with:- path: ${{ env.STORE_PATH }}- key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}- restore-keys: |- ${{ runner.os }}-pnpm-store-- name: install dependenciesrun: pnpm bootstrap- name: build frontend (nc-gui)@@ -38,12 +28,22 @@ jobs:run: |pnpm run buildtimeout-minutes: 20- - name: upload frontend (nc-gui) build to artf server- working-directory: ./+ - name: Create build archive+ working-directory: ./packages/nc-guirun: |- # expects the variables to be available in runner context.FILE="$(echo ${GITHUB_REPOSITORY} | sed "s,/,-,g")-${GITHUB_RUN_ID}.zip"- cd ./packages/nc-gui/zip -r ${FILE} .output || echo "UI build directory does not exists" >&2- echo "uploading ${FILE} to http://65.21.27.147/upload/${FILE}"- time curl -T "${FILE}" http://65.21.27.147/upload/${FILE} -n+ echo "ARCHIVE_NAME=${FILE}" >> $GITHUB_ENV++ - name: Configure AWS credentials+ uses: aws-actions/configure-aws-credentials@v4+ with:+ aws-access-key-id: ${{ secrets.ARTIFACTS_S3_ACCESS_KEY }}+ aws-secret-access-key: ${{ secrets.ARTIFACTS_S3_SECRET_KEY }}+ aws-region: us-east-2++ - name: Upload UI build to S3+ working-directory: ./packages/nc-gui+ run: |+ aws s3 cp ${ARCHIVE_NAME} s3://nocohub-ci-artifacts/ui-builds/${ARCHIVE_NAME}+ echo "s3://nocohub-ci-artifacts/ui-builds/${ARCHIVE_NAME}"