Skip to content

Project setup: Next.js, Clean Architecture, Husky, CI, SonarCloud #19

Project setup: Next.js, Clean Architecture, Husky, CI, SonarCloud

Project setup: Next.js, Clean Architecture, Husky, CI, SonarCloud #19

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
types: [opened, synchronize, reopened]
jobs:
check:
name: Lint, format, typecheck, build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version: '20'
- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Lint
run: pnpm exec eslint . --max-warnings 0
- name: Format check
run: pnpm run format:check
- name: Typecheck
run: pnpm run typecheck
- name: Test
run: pnpm test
- name: Build
run: pnpm run build
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
needs: check
if: github.ref == 'refs/heads/main' || (github.event_name == 'pull_request' && github.base_ref == 'main')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version: '20'
- name: Install dependencies
run: pnpm install --frozen-lockfile --ignore-scripts
- name: Test with coverage
run: pnpm run test:coverage
- name: SonarCloud scan
uses: SonarSource/sonarqube-scan-action@v5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}