From 69e2dc9b79bff0e850cac94eb81bc50efcb92de5 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Wed, 29 Jun 2022 11:30:28 +0530 Subject: [PATCH] fix: cypress quick test enable in CICD Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .github/workflows/ci-cd.yml | 90 +++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 25793d026f..84f78a65c0 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -547,6 +547,96 @@ jobs: name: cypress-xcdb-restMisc-run-cache-snapshots path: scripts/cypress/screenshots retention-days: 2 + cy-quick-sqlite: + 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: Set env + run: echo "NODE_ENV=test" >> $GITHUB_ENV + - name: Cypress run + uses: cypress-io/github-action@v2 + with: + start: | + npm run build:common + npm run start:api:cache + npm run start:web + docker-compose -f ./scripts/docker-compose-cypress.yml up -d + spec: "./scripts/cypress/integration/common/9a_QuickTest.js" + wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/runtime.js" + wait-on-timeout: 1200 + config-file: scripts/cypress/cypress.json + - name: Upload screenshots + if: always() + uses: actions/upload-artifact@v2 + with: + name: cy-quick-sqlite-snapshots + path: scripts/cypress/screenshots + retention-days: 2 + cy-quick-pg: + 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: Set env + run: echo "NODE_ENV=test" >> $GITHUB_ENV + - name: Cypress run + uses: cypress-io/github-action@v2 + with: + start: | + npm run build:common + npm run start:api:cache:pg + npm run start:web + docker-compose -f ./scripts/cypress/docker-compose-pg-cy-quick.yml up -d + spec: "./scripts/cypress/integration/common/9a_QuickTest.js" + wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/runtime.js" + wait-on-timeout: 1200 + config-file: scripts/cypress/cypress.json + - name: Upload screenshots + if: always() + uses: actions/upload-artifact@v2 + with: + name: cy-quick-pg-snapshots + path: scripts/cypress/screenshots + retention-days: 2 # docker: # runs-on: ubuntu-latest # steps: