From 01c81b6809f6425abf794a8f082832d3c7fecf1f Mon Sep 17 00:00:00 2001 From: j-mahapatra Date: Sun, 20 Oct 2024 09:20:35 +0530 Subject: [PATCH] feat: Add github action for type, lint and build checks --- .github/workflows/ci.yml | 67 ++++++++++++++++++++++++++++++++++++++++ package.json | 3 +- 2 files changed, 69 insertions(+), 1 deletion(-) 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..97cee0f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,67 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + typescript: + name: TypeScript Check + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + run: npm install + + - name: TypeScript check + run: npm run type-check + + linting: + name: Lint Check + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + run: npm install + + - name: Lint check + run: npm run lint + + build: + name: Build Check + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + + - name: Install dependencies + run: npm install + + - name: Build project + run: npm run build diff --git a/package.json b/package.json index 0de4183..ce18afd 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "type-check": "tsc --noEmit" }, "dependencies": { "@auth/prisma-adapter": "^2.5.0",