From b1aae5c53339989771a9a76ef72086541431bbf0 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Mon, 12 Sep 2022 18:14:55 +0530 Subject: [PATCH] feat/Added github action for unit tests --- .github/workflows/ci-cd.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 5cfc98e157..c61c59d4cc 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -635,3 +635,33 @@ jobs: name: cy-quick-pg-snapshots path: scripts/cypress/screenshots retention-days: 2 + unit-tests: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: install dependencies nocodb-sdk + working-directory: ./packages/nocodb-sdk + run: npm ci + - name: build nocodb-sdk + working-directory: ./packages/nocodb-sdk + run: npm run build:main + - name: install dependencies nocodb + working-directory: ./packages/nocodb + run: npm ci + - name: setup mysql + working-directory: ./ + run: docker-compose -f ./scripts/docker-compose-cypress.yml up -d + - name: run unit tests + working-directory: ./packages/nocodb + run: npm run test:unit \ No newline at end of file