From 67c6a12be4834a93f13c8b6309d89858dee615ca Mon Sep 17 00:00:00 2001 From: Pablo Lara Date: Fri, 5 Jul 2024 12:55:30 +0200 Subject: [PATCH] feat: add CI checks using GitHub actions --- .github/workflows/checks.yml | 28 ++++++++++++++++++++++++++++ package.json | 11 ++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/checks.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000000..6e2b609c59 --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,28 @@ +name: CI - Code Quality and Health Check + +on: + pull_request: + branches: + - main + - develop + +jobs: + test-and-coverage: + runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest] + node-version: [20.x] + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + persist-credentials: false + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - name: Install dependencies + run: npm install + - name: Run Healthcheck + run: npm healthcheck diff --git a/package.json b/package.json index bf3e18e014..b9cda2335c 100644 --- a/package.json +++ b/package.json @@ -41,10 +41,15 @@ "name": "prowler-next-app", "private": true, "scripts": { - "build": "next build", "dev": "next dev", - "lint": "eslint . --ext .ts,.tsx -c .eslintrc.json --fix", - "start": "next start" + "build": "next build", + "start": "next start", + "typecheck": "tsc", + "healthcheck": "npm run typecheck && npm run lint:check", + "lint:check": "./node_modules/.bin/eslint ./app", + "lint:fix": "eslint . --ext .ts,.tsx -c .eslintrc.json --fix", + "format:check": "./node_modules/.bin/prettier --check ./app", + "format:write": "./node_modules/.bin/prettier --config .prettierrc.json --write ./app" }, "version": "0.0.1" }