From e5271f49c3c16c9e99d27aa543effe6af1293272 Mon Sep 17 00:00:00 2001 From: sakshi Date: Sun, 17 Nov 2024 10:34:43 +0530 Subject: [PATCH] workflow is there --- .github/workflows/integration.yml | 58 +++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/integration.yml diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 0000000..5f50112 --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,58 @@ +# 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: Integration # what this yml file is going to indicate + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + #all these jobs are going to run on server not on local machine + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] #we are telling github to run the jobs on these versions of node js + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v4 #it tells github to checkout to the current branch + - name: Use Node.js ${{ matrix.node-version }} #optional + uses: actions/setup-node@v4 #it tells github to setting up the node environment before doing anything else for the project + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' #by using npm we can handle all our packages + - name: "Installing dependencies" + # installing dependencies + run: npm i + # Build command + - name: "Build Command" + run: npm run build + + test: + #all these jobs are going to run on server not on local machine + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] #we are telling github to run the jobs on these versions of node js + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v4 #it tells github to checkout to the current branch + - name: Use Node.js ${{ matrix.node-version }} #optional + uses: actions/setup-node@v4 #it tells github to setting up the node environment before doing anything else for the project + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' #by using npm we can handle all our packages + - name: "Installing dependencies" + # installing dependencies + run: npm i + + - name: "Running testcases" + run: npm run test +