From 9ec3da1a681b3debe8094d667f46467dd6e8dccb Mon Sep 17 00:00:00 2001 From: ApurvaBasule <97452527+ApurvaBasule@users.noreply.github.com> Date: Tue, 13 Aug 2024 15:41:36 +0530 Subject: [PATCH] build and test ci pipeline --- .github/workflows/node.yml | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 0d919c97..a244fa5f 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -17,10 +17,10 @@ jobs: mongodb-version: ['5.0'] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v2 - name: Use Node.js version ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} @@ -28,14 +28,26 @@ jobs: uses: supercharge/mongodb-github-action@1.11.0 with: mongodb-version: ${{ matrix.mongodb-version }} + + - name: Clean and Install server dependencies + run: | + rm -rf server/node_modules + npm install --prefix server + + - name: Install client dependencies + run: npm install --prefix client + + - name: Build client + run: npm run build --prefix client + + - name: Set Jest permissions + run: chmod +x server/node_modules/.bin/jest + + - name: Run Server Tests + run: npm test --prefix server + + - name: Run Client Tests + run: npm test --prefix client - - name: Install dependencies - run: npm install - - - name: Build and Start Application - run: npm run deploy - - - name: Run Tests - run: npm test