From e7d50966715d436c3966eee33a3ccb0c2fc162ef Mon Sep 17 00:00:00 2001 From: Aditya Samal <152994566+aditya-samal@users.noreply.github.com> Date: Sat, 28 Dec 2024 13:32:08 +0530 Subject: [PATCH 1/4] Create node.js.yml --- .github/workflows/node.js.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 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..1d71cd8 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,32 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Node.js CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: cd server + - run: npm ci + - run: npm run build --if-present + - run: npm test From 03a361ca1e4650c1ea0db4c2d23a6ccf6ba8fd6b Mon Sep 17 00:00:00 2001 From: aditya-samal Date: Sat, 28 Dec 2024 13:38:02 +0530 Subject: [PATCH 2/4] Yml --- .github/workflows/node.js.yml | 40 +++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 1d71cd8..b5fe30d 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -1,17 +1,13 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - name: Node.js CI on: push: - branches: [ "master" ] + branches: ["master"] pull_request: - branches: [ "master" ] + branches: ["master"] jobs: build: - runs-on: ubuntu-latest strategy: @@ -20,13 +16,25 @@ jobs: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: cd server - - run: npm ci - - run: npm run build --if-present - - run: npm test + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + + # Set the working directory for subsequent commands + - run: cd server + + # Use npm ci with the working directory option + - run: npm ci + working-directory: server + + # Build the project with the working directory option + - run: npm run build --if-present + working-directory: server + + # Run tests with the working directory option + - run: npm test + working-directory: server From 48952f57f29d8d93f7690ae94c0f47d2d569a5e5 Mon Sep 17 00:00:00 2001 From: aditya-samal Date: Sat, 28 Dec 2024 13:40:12 +0530 Subject: [PATCH 3/4] Yml --- .github/workflows/node.js.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index b5fe30d..7fa715d 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -18,15 +18,15 @@ jobs: steps: - uses: actions/checkout@v4 + # Set the working directory for subsequent commands + - run: cd server + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: "npm" - # Set the working directory for subsequent commands - - run: cd server - # Use npm ci with the working directory option - run: npm ci working-directory: server From 13c5a89ec72d3738b805a57504993c6e82d2ae06 Mon Sep 17 00:00:00 2001 From: aditya-samal Date: Sat, 28 Dec 2024 13:41:09 +0530 Subject: [PATCH 4/4] Yml --- .github/workflows/node.js.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 7fa715d..b0e25eb 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -22,6 +22,7 @@ jobs: - run: cd server - name: Use Node.js ${{ matrix.node-version }} + working-directory: server uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }}