|
|
@ -13,37 +13,16 @@ on: |
|
|
|
|
|
|
|
|
|
|
|
jobs: |
|
|
|
jobs: |
|
|
|
playwright: |
|
|
|
playwright: |
|
|
|
runs-on: [self-hosted, v2] |
|
|
|
runs-on: [self-hosted, v3] |
|
|
|
timeout-minutes: 100 |
|
|
|
timeout-minutes: 100 |
|
|
|
steps: |
|
|
|
steps: |
|
|
|
- name: Checkout |
|
|
|
- name: Checkout |
|
|
|
uses: actions/checkout@v3 |
|
|
|
uses: actions/checkout@v3 |
|
|
|
- name: pre-requisite checks |
|
|
|
|
|
|
|
shell: bash |
|
|
|
|
|
|
|
run: | |
|
|
|
|
|
|
|
node_version=$(node --version || echo "error") |
|
|
|
|
|
|
|
pnpm_version=$(pnpm -v || echo "error") |
|
|
|
|
|
|
|
echo "node version: $node_version" |
|
|
|
|
|
|
|
echo "pnpm version: $pnpm_version" |
|
|
|
|
|
|
|
if [[ $node_version != v18* ]] || [[ $pnp_version != 8* ]]; then |
|
|
|
|
|
|
|
echo "version mismatch: expected node v18 and pnpm v8" |
|
|
|
|
|
|
|
RUN_PRERQUISITE_STEPS="true" |
|
|
|
|
|
|
|
elif [[ ${FORCE_RUN_PRERQUISITE_STEPS} == "true" ]]; |
|
|
|
|
|
|
|
# || [[ ! -f ${PRE_REQ_CHECK_FILE_PATH} ]]; |
|
|
|
|
|
|
|
then |
|
|
|
|
|
|
|
echo "FORCE_RUN_PRERQUISITE_STEPS is true" |
|
|
|
|
|
|
|
RUN_PRERQUISITE_STEPS="true" |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
RUN_PRERQUISITE_STEPS="false" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
echo "RUN_PRERQUISITE_STEPS=${RUN_PRERQUISITE_STEPS}" >> $GITHUB_ENV |
|
|
|
|
|
|
|
- name: Setup Node |
|
|
|
- name: Setup Node |
|
|
|
if: env.RUN_PRERQUISITE_STEPS == 'true' |
|
|
|
|
|
|
|
uses: actions/setup-node@v3 |
|
|
|
uses: actions/setup-node@v3 |
|
|
|
with: |
|
|
|
with: |
|
|
|
node-version: 18.14.0 |
|
|
|
node-version: 18.14.0 |
|
|
|
- name: Setup pnpm |
|
|
|
- name: Setup pnpm |
|
|
|
if: env.RUN_PRERQUISITE_STEPS == 'true' |
|
|
|
|
|
|
|
uses: pnpm/action-setup@v2 |
|
|
|
uses: pnpm/action-setup@v2 |
|
|
|
with: |
|
|
|
with: |
|
|
|
version: 8 |
|
|
|
version: 8 |
|
|
@ -51,8 +30,21 @@ jobs: |
|
|
|
shell: bash |
|
|
|
shell: bash |
|
|
|
run: | |
|
|
|
run: | |
|
|
|
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV |
|
|
|
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV |
|
|
|
|
|
|
|
- name: check if npm cache is needed |
|
|
|
|
|
|
|
shell: bash |
|
|
|
|
|
|
|
run: | |
|
|
|
|
|
|
|
IS_NPM_CACHE_DOWNLOAD_REQUIRED="/cache-marker-v1.txt" |
|
|
|
|
|
|
|
# update the above file name to force the cache ex: /cache-marker-v2.txt. |
|
|
|
|
|
|
|
if [[ ! -f ${PRE_REQ_CHECK_FILE_PATH} ]]; |
|
|
|
|
|
|
|
then |
|
|
|
|
|
|
|
echo "IS_NPM_CACHE_DOWNLOAD_REQUIRED is true" |
|
|
|
|
|
|
|
IS_NPM_CACHE_DOWNLOAD_REQUIRED="true" |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
IS_NPM_CACHE_DOWNLOAD_REQUIRED="false" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
echo "IS_NPM_CACHE_DOWNLOAD_REQUIRED=${IS_NPM_CACHE_DOWNLOAD_REQUIRED}" >> $GITHUB_ENV |
|
|
|
- uses: actions/cache@v3 |
|
|
|
- uses: actions/cache@v3 |
|
|
|
if: env.RUN_PRERQUISITE_STEPS == 'true' |
|
|
|
if: env.IS_NPM_CACHE_DOWNLOAD_REQUIRED == 'true' |
|
|
|
name: Setup pnpm cache |
|
|
|
name: Setup pnpm cache |
|
|
|
with: |
|
|
|
with: |
|
|
|
path: ${{ env.STORE_PATH }} |
|
|
|
path: ${{ env.STORE_PATH }} |
|
|
@ -113,22 +105,28 @@ jobs: |
|
|
|
working-directory: ./packages/nocodb |
|
|
|
working-directory: ./packages/nocodb |
|
|
|
run: | |
|
|
|
run: | |
|
|
|
pnpm run watch:run:playwright:pg &> ${{ inputs.db }}_${{ inputs.shard }}_test_backend.log & |
|
|
|
pnpm run watch:run:playwright:pg &> ${{ inputs.db }}_${{ inputs.shard }}_test_backend.log & |
|
|
|
- name: copy built output and start frontend |
|
|
|
- name: download ui build from artf server |
|
|
|
if: always() |
|
|
|
working-directory: ./packages/nc-gui/ |
|
|
|
working-directory: ./ |
|
|
|
|
|
|
|
run: | |
|
|
|
run: | |
|
|
|
# expects the variables to be available in runner context. |
|
|
|
# expects the variables to be available in runner context. |
|
|
|
path="gh-artifacts/runs/${GITHUB_RUN_ID}/ui-build/.output" |
|
|
|
rm -rf .output.zip .output |
|
|
|
target_dir="/mnt/${path}" |
|
|
|
FILE="$(echo ${GITHUB_REPOSITORY} | sed "s,/,-,g")-${GITHUB_RUN_ID}.zip" |
|
|
|
mkdir -p ${target_dir} |
|
|
|
BUILD_FILE_URL=http://65.21.27.147/gh-artifacts/ui-builds/${FILE} |
|
|
|
if [[ -d ${target_dir} ]]; then |
|
|
|
time curl -o output.zip ${BUILD_FILE_URL} -n |
|
|
|
echo "Directory ${target_dir} exists." |
|
|
|
unzip -oq output.zip |
|
|
|
cp -r ${target_dir} ./packages/nc-gui/ || echo "playwright reports directory does not exists" >> ${target_dir}/playwright-report/index.html |
|
|
|
|
|
|
|
else |
|
|
|
# path="gh-artifacts/runs/${GITHUB_RUN_ID}/ui-build/.output" |
|
|
|
echo "Error: Directory ${target_dir} does not exists." |
|
|
|
# target_dir="/mnt/${path}" |
|
|
|
exit 1 |
|
|
|
# if [[ -d ${target_dir} ]]; then |
|
|
|
fi |
|
|
|
# echo "Directory ${target_dir} exists." |
|
|
|
cd ./packages/nc-gui/ |
|
|
|
# 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 frontend |
|
|
|
|
|
|
|
working-directory: ./packages/nc-gui/ |
|
|
|
|
|
|
|
run: | |
|
|
|
pnpm run ci:start |
|
|
|
pnpm run ci:start |
|
|
|
- name: Install Playwright Browsers |
|
|
|
- name: Install Playwright Browsers |
|
|
|
working-directory: ./tests/playwright |
|
|
|
working-directory: ./tests/playwright |
|
|
@ -183,7 +181,8 @@ jobs: |
|
|
|
# - name: Run quick tests |
|
|
|
# - name: Run quick tests |
|
|
|
# if: ${{ inputs.db == 'sqlite' }} |
|
|
|
# if: ${{ inputs.db == 'sqlite' }} |
|
|
|
# working-directory: ./tests/playwright |
|
|
|
# working-directory: ./tests/playwright |
|
|
|
# run: PLAYWRIGHT_HTML_REPORT=playwright-report-quick npm run test:quick |
|
|
|
# run: PLAYWRIGHT_HTML_REPORT=playwright-report-quick npm run test:quick |
|
|
|
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3 |
|
|
|
- uses: actions/upload-artifact@v3 |
|
|
|
if: ${{ inputs.db == 'sqlite' }} |
|
|
|
if: ${{ inputs.db == 'sqlite' }} |
|
|
|
with: |
|
|
|
with: |
|
|
@ -234,6 +233,6 @@ jobs: |
|
|
|
cp -r ./tests/playwright/playwright-report ${target_dir}/ || echo "playwright reports directory does not exists" >> ${target_dir}/playwright-report/index.html |
|
|
|
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 |
|
|
|
cp ./packages/nocodb/*_test_backend.log ${target_dir}/ || echo "backend logs file does not exists" >> ${target_dir}/index.html |
|
|
|
# end: artifacts copy |
|
|
|
# end: artifacts copy |
|
|
|
SUMMARY='[Artifacts](http://135.181.48.96/'${path}') |
|
|
|
SUMMARY='[Artifacts]('${REPORTS_HOST}/${path}') |
|
|
|
[playwright-report](http://135.181.48.96/'${path}'/playwright-report)' |
|
|
|
[playwright-report]('${REPORTS_HOST}/${path}'/playwright-report)' |
|
|
|
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY |
|
|
|
echo "$SUMMARY" >> $GITHUB_STEP_SUMMARY |