editted build.yml and pom.xml

This commit is contained in:
KoonQi 2023-09-06 00:30:39 +08:00
parent 714bc57b29
commit 484fdc2344
2 changed files with 55 additions and 46 deletions

View file

@ -3,7 +3,7 @@ name: Build and Test
on:
push:
branches:
- '*'
- "*"
jobs:
build:
@ -16,8 +16,8 @@ jobs:
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
java-version: "17"
distribution: "adopt"
- name: Build with Maven
run: mvn clean package
@ -32,30 +32,31 @@ jobs:
name: build-artifacts
path: target/
# Static Code Analysis with Checkstyle (Replace with your preferred tool)
- name: Static Code Analysis
# Static Code Analysis with Checkstyle
- name: Static Code Analysis with Checkstyle
run: |
# Install and run Checkstyle (replace with your tool)
# Example: mvn checkstyle:check
echo "Run your static code analysis tool here"
# 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: path/to/static/code/analysis/reports
path: .github/workflows/reports/checkstyle/
# Code Coverage (Replace with your preferred tool)
# Code Coverage
- name: Code Coverage
run: |
# Run your code coverage tool here
# Example: mvn jacoco:report
echo "Run your code coverage tool here"
# 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: path/to/code/coverage/reports
path: .github/workflows/reports/jacoco/

14
pom.xml
View file

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic</artifactId>
@ -33,6 +35,10 @@
<nohttp-checkstyle.version>0.0.11</nohttp-checkstyle.version>
<spring-format.version>0.0.39</spring-format.version>
<!-- ... other properties ... -->
<testcontainers.version>1.16.3</testcontainers.version>
</properties>
<dependencies>
@ -166,7 +172,8 @@
<configuration>
<rules>
<requireJavaVersion>
<message>This build requires at least Java ${java.version}, update your JVM, and run the build again</message>
<message>This build requires at least Java ${java.version}, update your JVM, and
run the build again</message>
<version>${java.version}</version>
</requireJavaVersion>
</rules>
@ -370,7 +377,8 @@
<configuration>
<inputPath>${basedir}/src/main/scss/</inputPath>
<outputPath>${basedir}/src/main/resources/static/resources/css/</outputPath>
<includePath>${project.build.directory}/webjars/META-INF/resources/webjars/bootstrap/${webjars-bootstrap.version}/scss/</includePath>
<includePath>
${project.build.directory}/webjars/META-INF/resources/webjars/bootstrap/${webjars-bootstrap.version}/scss/</includePath>
</configuration>
</plugin>
</plugins>