|
|
|
@ -11,6 +11,7 @@ on:
|
|
|
|
|
- "packages/nocodb/**" |
|
|
|
|
- ".github/workflows/ci-cd.yml" |
|
|
|
|
pull_request: |
|
|
|
|
types: [ready_for_review] |
|
|
|
|
branches: [develop] |
|
|
|
|
paths: |
|
|
|
|
- "packages/nc-gui/**" |
|
|
|
@ -635,3 +636,42 @@ jobs:
|
|
|
|
|
name: cy-quick-pg-snapshots |
|
|
|
|
path: scripts/cypress/screenshots |
|
|
|
|
retention-days: 2 |
|
|
|
|
unit-tests: |
|
|
|
|
runs-on: ubuntu-20.04 |
|
|
|
|
steps: |
|
|
|
|
- name: Setup Node |
|
|
|
|
uses: actions/setup-node@v1 |
|
|
|
|
with: |
|
|
|
|
node-version: 16.15.0 |
|
|
|
|
- name: Checkout |
|
|
|
|
uses: actions/checkout@v2 |
|
|
|
|
with: |
|
|
|
|
fetch-depth: 0 |
|
|
|
|
- name: Cache node modules |
|
|
|
|
uses: actions/cache@v2 |
|
|
|
|
env: |
|
|
|
|
cache-name: cache-node-modules |
|
|
|
|
|
|
|
|
|
with: |
|
|
|
|
# npm cache files are stored in `~/.npm` on Linux/macOS |
|
|
|
|
path: ~/.npm |
|
|
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} |
|
|
|
|
restore-keys: | |
|
|
|
|
${{ runner.os }}-build-${{ env.cache-name }}- |
|
|
|
|
${{ runner.os }}-build- |
|
|
|
|
${{ runner.os }}- |
|
|
|
|
- name: install dependencies nocodb-sdk |
|
|
|
|
working-directory: ./packages/nocodb-sdk |
|
|
|
|
run: npm install |
|
|
|
|
- name: build nocodb-sdk |
|
|
|
|
working-directory: ./packages/nocodb-sdk |
|
|
|
|
run: npm run build:main |
|
|
|
|
- name: Install dependencies |
|
|
|
|
working-directory: ./packages/nocodb |
|
|
|
|
run: npm install |
|
|
|
|
- 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 |