Add linter actions

This commit is contained in:
2025-11-10 16:06:05 +01:00
parent 7496a77213
commit 8024fba4aa
4 changed files with 92 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
name: Compile Java Backend
on:
pull_request:
paths:
- SmartClinicManagementSystem/**
push:
paths:
- SmartClinicManagementSystem/**
jobs:
compile-backend:
runs-on: node20
name: Compile Backend Code
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Compile with Gradle
run: |
cd SmartClinicManagementSystem/app
../../gradlew clean build

View File

@@ -0,0 +1,24 @@
name: Lint Java Backend
on:
pull_request:
paths:
- SmartClinicManagementSystem/**
push:
paths:
- SmartClinicManagementSystem/**
jobs:
lint-java:
runs-on: node20
name: Checkstyle Java Linting
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Download Checkstyle
run: curl -L -o checkstyle.jar https://github.com/checkstyle/checkstyle/releases/download/checkstyle-10.12.1/checkstyle-10.12.1-all.jar
- name: Run Checkstyle
run: |
java -jar checkstyle.jar -c /google_checks.xml app/src/main/java/com/project/back_end || true

View File

@@ -0,0 +1,18 @@
name: Lint Dockerfiles
on:
pull_request:
paths:
- SmartClinicManagementSystem/**
push:
paths:
- SmartClinicManagementSystem/**
jobs:
dockerlint:
runs-on: node20
name: Lint Dockerfiles
steps:
- uses: actions/checkout@v3
- name: Run hadolint
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ./SmartClinicManagementSystem/app/Dockerfile

View File

@@ -0,0 +1,27 @@
name: Lint Frontend
on:
pull_request:
paths:
- SmartClinicManagementSystem/**
push:
paths:
- SmartClinicManagementSystem/**
jobs:
lint-frontend:
runs-on: node20
name: Lint HTML, CSS, and JS
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install linters
run: |
npm install -g htmlhint stylelint eslint
- name: Lint HTML
run: htmlhint SmartClinicManagementSystem/app/src/main/resources/static/assets/pages//*.html || true
- name: Lint CSS
run: stylelint "SmartClinicManagementSystem/app/src/main/resources/static/assets/css//*.css" || true
- name: Lint JS
run: eslint SmartClinicManagementSystem/app/src/main/resources/static/assets/js//*.js || true