mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 08:15:49 +00:00
add report code into .yml
This commit is contained in:
parent
49ae440d0a
commit
97a261903a
1 changed files with 39 additions and 10 deletions
49
.github/workflows/build.yml
vendored
49
.github/workflows/build.yml
vendored
|
@ -3,34 +3,63 @@ name: Build and Test
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- "*" # Trigger on all branches
|
||||
- "*" # Trigger on all branches
|
||||
pull_request:
|
||||
branches: [main] # Trigger on pull requests to the 'main' branch
|
||||
branches: [main] # Trigger on pull requests to the 'main' branch
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest # Use the latest version of Ubuntu as the runner
|
||||
runs-on: ubuntu-latest # Use the latest version of Ubuntu as the runner
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2 # Checkout your repository's code
|
||||
uses: actions/checkout@v2 # Checkout your repository's code
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v2 # Set up Java Development Kit (JDK) version 17
|
||||
uses: actions/setup-java@v2 # Set up Java Development Kit (JDK) version 17
|
||||
with:
|
||||
java-version: "17"
|
||||
distribution: "adopt"
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvn clean package # Clean and package your Maven project
|
||||
run: mvn clean package # Clean and package your Maven project
|
||||
|
||||
- name: Run tests with Maven
|
||||
run: mvn test # Run tests using Maven
|
||||
run: mvn test # Run tests using Maven
|
||||
|
||||
# Store build artifacts for history
|
||||
- name: Archive Build Artifacts
|
||||
uses: actions/upload-artifact@v2 # Upload build artifacts to the workflow
|
||||
uses: actions/upload-artifact@v2 # Upload build artifacts to the workflow
|
||||
with:
|
||||
name: build-artifacts # Name for the uploaded artifacts
|
||||
name: build-artifacts # Name for the uploaded artifacts
|
||||
path:
|
||||
target/ # Path to the build artifacts (typically 'target/' for Maven)
|
||||
target/ # Path to the build artifacts (typically 'target/' for Maven)
|
||||
|
||||
|
||||
# Static Code Analysis with Checkstyle
|
||||
- name: Static Code Analysis with Checkstyle
|
||||
run: |
|
||||
# Install and run Checkstyle
|
||||
mvn org.apache.maven.plugins:maven-checkstyle-plugin:3.1.1:checkstyle
|
||||
# Run Checkstyle
|
||||
mvn checkstyle:check
|
||||
|
||||
# Store static code analysis reports
|
||||
- name: Archive Static Code Analysis Reports
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: static-code-analysis-reports
|
||||
path: target/checkstyle-result.xml
|
||||
|
||||
# Code Coverage
|
||||
- name: Code Coverage
|
||||
run: |
|
||||
# Run JaCoCo report generation
|
||||
mvn jacoco:report
|
||||
|
||||
# Store code coverage reports
|
||||
- name: Archive Code Coverage Reports
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: code-coverage-reports
|
||||
path: target/site/jacoco/
|
||||
|
|
Loading…
Reference in a new issue