From bf7e2aa07e822e8bb9bc292d7de5b6c7fc46a3ce Mon Sep 17 00:00:00 2001 From: Ajay Negi Date: Sun, 1 Sep 2024 23:05:29 +0530 Subject: [PATCH] Spring Boot CI Pipeline --- .github/workflows/java-code-quality.yml | 55 ------------------------- .github/workflows/maven-publish.yml | 34 --------------- 2 files changed, 89 deletions(-) delete mode 100644 .github/workflows/java-code-quality.yml delete mode 100644 .github/workflows/maven-publish.yml diff --git a/.github/workflows/java-code-quality.yml b/.github/workflows/java-code-quality.yml deleted file mode 100644 index 4ee78c4..0000000 --- a/.github/workflows/java-code-quality.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Java Code Quality and Formatting - -on: [push, pull_request] - -jobs: - lint: - name: Analyze and Lint Java Code - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - # This step checks out the code from your repository so the workflow can analyze it. - - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - # This step sets up Java Development Kit (JDK) version 17, which is required to compile and run your Java code. - - - name: Cache Maven dependencies - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - # This step caches Maven dependencies to speed up the build process. It saves the downloaded dependencies - # so that they don't need to be downloaded again in future runs unless the `pom.xml` file changes. - - - name: Install dependencies - run: mvn install -DskipTests - # This command installs all the necessary dependencies for your project based on the `pom.xml` file. - # The `-DskipTests` flag is used to skip running tests at this stage, focusing on dependency installation. - - - name: Run Checkstyle - run: mvn checkstyle:check - # This command runs Checkstyle, a tool that checks your Java code against defined coding standards. - # It helps ensure that your code follows best practices and is consistently formatted. - - - name: Run PMD - run: mvn pmd:check - # This command runs PMD, a static code analysis tool that looks for potential bugs and code quality issues. - # It helps you identify common mistakes or bad practices in your code. - - - name: Run SpotBugs - run: mvn spotbugs:check - # This command runs SpotBugs, another static analysis tool that focuses on finding bugs in your code. - # SpotBugs can detect various types of bugs that could lead to issues in production. - - - name: Verify code formatting with Spotless (excluding Javadocs) - run: mvn spotless:check -Dspotless.apply.skip - # This command runs Spotless with the Javadoc checks skipped. - # The `-Dspotless.apply.skip` flag is used to bypass the application of Spotless checks for Javadocs. diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml deleted file mode 100644 index 6493613..0000000 --- a/.github/workflows/maven-publish.yml +++ /dev/null @@ -1,34 +0,0 @@ -# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created -# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path - -#name: Maven Package - -#on: -# release: -# types: [created] -# -#jobs: -# build: -# -# runs-on: ubuntu-latest -# permissions: -# contents: read -# packages: write -# -# steps: -# - uses: actions/checkout@v4 -# - name: Set up JDK 17 -# uses: actions/setup-java@v4 -# with: -# java-version: '17' -# distribution: 'temurin' -# server-id: github # Value of the distributionManagement/repository/id field of the pom.xml -# settings-path: ${{ github.workspace }} # location for the settings.xml file -# -# - name: Build with Maven -# run: mvn -B package --file pom.xml -# -# - name: Publish to GitHub Packages Apache Maven -# run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml -# env: -# GITHUB_TOKEN: ${{ github.token }}