From a53cd0a3c7b42f82c67bdb326b3809ba650b9c6e Mon Sep 17 00:00:00 2001 From: Hrishabh Gupta <113886587+Hrishabh3829@users.noreply.github.com> Date: Sat, 30 Aug 2025 22:47:51 +0530 Subject: [PATCH] Refactor Node.js CI workflow with linting step Updated CI workflow to include linting and reorganized steps. --- .github/workflows/node.js.yml | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..0ef38bb --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,37 @@ +name: LMS CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build-and-test: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run linter + run: npm run lint --if-present + + - name: Run tests + run: npm test --if-present + + - name: Build project + run: npm run build --if-present