Add linter actions
This commit is contained in:
23
.gitea/workflows/smart-clinic-compile-backend.yml
Normal file
23
.gitea/workflows/smart-clinic-compile-backend.yml
Normal 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
|
||||||
24
.gitea/workflows/smart-clinic-lint-backend.yml
Normal file
24
.gitea/workflows/smart-clinic-lint-backend.yml
Normal 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
|
||||||
18
.gitea/workflows/smart-clinic-lint-docker.yml
Normal file
18
.gitea/workflows/smart-clinic-lint-docker.yml
Normal 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
|
||||||
27
.gitea/workflows/smart-clinic-lint-frontend.yml
Normal file
27
.gitea/workflows/smart-clinic-lint-frontend.yml
Normal 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
|
||||||
Reference in New Issue
Block a user