diff --git a/.github/workflows/spring-boot-ci.yml b/.github/workflows/build-test-lint-format.yml similarity index 55% rename from .github/workflows/spring-boot-ci.yml rename to .github/workflows/build-test-lint-format.yml index 765ba73..03f928c 100644 --- a/.github/workflows/spring-boot-ci.yml +++ b/.github/workflows/build-test-lint-format.yml @@ -1,17 +1,16 @@ -name: Spring Boot CI Pipeline +name: Automated Testing on: push: branches: - - 'main' + - '**' pull_request: branches: - - '**' + - 'main' jobs: build-and-test: runs-on: ubuntu-latest - steps: - name: Checkout code uses: actions/checkout@v3 @@ -19,14 +18,22 @@ jobs: - name: Set up JDK 17 uses: actions/setup-java@v3 with: - distribution: 'temurin' 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 + run: mvn clean install -DskipTests - - name: Run Spring Boot Application - run: mvn spring-boot:run + - name: Run Tests + run: mvn test env: ENV: production DATABASE_URL: ${{ secrets.DATABASE_URL }} @@ -42,5 +49,27 @@ jobs: MAIL_SERVICE_STARTTLS: ${{ secrets.MAIL_SERVICE_STARTTLS }} MAIL_SERVICE_DOMAIN_NAME: ${{ secrets.MAIL_SERVICE_DOMAIN_NAME }} - - name: Run Tests - run: mvn test +# 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 diff --git a/.gitignore b/.gitignore index 5944935..49bad9c 100644 --- a/.gitignore +++ b/.gitignore @@ -35,5 +35,5 @@ build/ .DS_Store src/main/resources/application-dev.properties -.github/workflows/java-code-quality.yml + .github/workflows/maven-publish.yml diff --git a/src/main/java/com/libraryman_api/LibrarymanApiApplication.java b/src/main/java/com/libraryman_api/LibrarymanApiApplication.java index 6f54436..df9a8cf 100644 --- a/src/main/java/com/libraryman_api/LibrarymanApiApplication.java +++ b/src/main/java/com/libraryman_api/LibrarymanApiApplication.java @@ -2,8 +2,10 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableAsync; @SpringBootApplication +@EnableAsync public class LibrarymanApiApplication { public static void main(String[] args) {