From 8971a7f2cdde93c1cf05bd70d0a9a2fe984ab922 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 24 Aug 2021 13:13:01 +0530 Subject: [PATCH] chore(actions): cypress test Signed-off-by: Pranav C --- .github/workflows/ci-cd.yml | 4 ++-- docker-compose-cypress.yml | 43 ++++++++++++++++++++++++++---------- packages/nc-gui/package.json | 2 +- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 37b36304a4..c70b8c258a 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -4,7 +4,7 @@ name: "CI/CD" on: push: - branches: [ master ] + branches: [ master, cypress ] pull_request: branches: [ master ] @@ -19,7 +19,7 @@ jobs: with: start: docker-compose -f ./docker-compose-cypress.yml up wait-on: 'http://localhost:8080/dashboard' - wait-on-timeout: 240 + wait-on-timeout: 900 docker: runs-on: ubuntu-latest diff --git a/docker-compose-cypress.yml b/docker-compose-cypress.yml index b048d819d1..eb191e03e5 100644 --- a/docker-compose-cypress.yml +++ b/docker-compose-cypress.yml @@ -1,15 +1,34 @@ version: "3.5" services: - xc-cypress-test: - image: node:12.22.1-slim - ports: - - 8080:8080 - volumes: - - ./packages/nocodb:/home/app - command: - - /bin/bash - - -c - - | - echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" - cd /home/app/ && npm i && npm run run + mysql: + image: mysql:5.7 + restart: always + environment: + MYSQL_ROOT_PASSWORD: password + ports: + - 3306:3306 + volumes: + - ./packages/nocodb/tests/mysql-sakila-db:/docker-entrypoint-initdb.d + healthcheck: + test: "/etc/init.d/mysql status" + interval: 1s + retries: 240 + xc-cypress-nocodb: + image: node:12.22.1-slim + ports: + - "8080:8080" + volumes: + - ./packages/:/home/packages/ + depends_on: + - mysql + command: + - /bin/bash + - -c + - | + echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + apt-get update && apt-get install rsync -y + cp -r /home/packages/ /home/app/ + cd /home/app/nc-gui && npm i && npm run build:copy && cd ../nc-lib-gui && npm i + rm -rf /home/app/nocodb/node_modules/nc-lib-gui + cd /home/app/nocodb && npm i ../nc-lib-gui ; npm i && npm run run diff --git a/packages/nc-gui/package.json b/packages/nc-gui/package.json index 55658b6a01..7a117c9ca7 100644 --- a/packages/nc-gui/package.json +++ b/packages/nc-gui/package.json @@ -8,7 +8,7 @@ "lint": "eslint . --ext .js,.vue --fix --quiet", "start": "nuxt start", "generate": "nuxt generate", - "build:copy": "npm run build; rm -rf ../nc-lib-gui/lib/dist/; rsync -rvzh ./dist/ ../nc-lib-gui/lib/dist/", + "build:copy": "EE=true npm run build; rm -rf ../nc-lib-gui/lib/dist/; rsync -rvzh ./dist/ ../nc-lib-gui/lib/dist/", "build:copy:jsdeliver": "EE=true npm run build; rm -rf ../nc-lib-gui/lib/dist/; rsync -rvzh ./dist/ ../nc-lib-gui/lib/dist/ ; npm publish ../nc-lib-gui" }, "dependencies": {