From 7fc6389db4fd3e8a46a2cb45d6fdf4c2e4a197e4 Mon Sep 17 00:00:00 2001 From: Surendar Singh Date: Wed, 16 Oct 2024 11:29:49 +0530 Subject: [PATCH] ci: add github workflows --- .github/workflows/CI.yml | 39 +++++++++++++++++++++++++++++++++++++++ package.json | 2 ++ 2 files changed, 41 insertions(+) create mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..94b6334 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,39 @@ +name: CI + +on: + push: + branches: + - 'main' + - 'develop' + pull_request: + branches: + - '**' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'yarn' + + - name: Install dependencies + run: yarn + + - name: Run linter + run: yarn lint:check + + - name: Run Prettier + run: yarn prettier:check + + - name: Run tests + run: yarn test:coverage + + - name: Build + run: yarn build diff --git a/package.json b/package.json index 936194b..d6b2c0a 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,8 @@ "build:production": "cp ./env/.env.production .env && next build", "start": "next start", "test": "jest --watch", + "test:coverage": "jest --coverage", + "build": "next build", "lint:check": "next lint", "lint:fix": "next lint --fix", "build:staging": "cp ./env/.env.staging .env && next build",