Skip to content

Commit

Permalink
Implement code quality and formatting checks
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaynegi45 committed Sep 2, 2024
1 parent 4572a5c commit 0c26b57
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 131 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/build-test-lint-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Automated Testing

on:
push:
branches:
- '**'
pull_request:
branches:
- 'main'

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Cache Maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Install dependencies
run: mvn clean install -DskipTests

- name: Run Tests
run: mvn test
env:
ENV: production
DATABASE_URL: ${{ secrets.DATABASE_URL }}
DATABASE_USERNAME: ${{ secrets.DATABASE_USERNAME }}
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
DATABASE_DRIVER_CLASS_NAME: ${{ secrets.DATABASE_DRIVER_CLASS_NAME }}

MAIL_SERVICE_HOST: ${{ secrets.MAIL_SERVICE_HOST }}
MAIL_SERVICE_PORT: ${{ secrets.MAIL_SERVICE_PORT }}
MAIL_SERVICE_USERNAME: ${{ secrets.MAIL_SERVICE_USERNAME }}
MAIL_SERVICE_PASSWORD: ${{ secrets.MAIL_SERVICE_PASSWORD }}
MAIL_SERVICE_SMTP: ${{ secrets.MAIL_SERVICE_SMTP }}
MAIL_SERVICE_STARTTLS: ${{ secrets.MAIL_SERVICE_STARTTLS }}
MAIL_SERVICE_DOMAIN_NAME: ${{ secrets.MAIL_SERVICE_DOMAIN_NAME }}

lint-and-format:
runs-on: ubuntu-latest
needs: build-and-test
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Run Checkstyle
run: mvn checkstyle:check

- name: Run PMD
run: mvn pmd:check

- name: Run SpotBugs
run: mvn spotbugs:check

- name: Verify code formatting with Spotless (excluding Javadocs)
run: mvn spotless:check -Dspotless.apply.skip
55 changes: 0 additions & 55 deletions .github/workflows/java-code-quality.yml

This file was deleted.

76 changes: 0 additions & 76 deletions .github/workflows/spring-boot-ci.yml

This file was deleted.

0 comments on commit 0c26b57

Please sign in to comment.