changed build and test a bit

This commit is contained in:
KoonQi 2023-09-07 15:35:04 +08:00
parent 7bfd3b9d51
commit d9bade79f6

View file

@ -21,26 +21,28 @@ jobs:
java-version: "17" java-version: "17"
distribution: "adopt" distribution: "adopt"
- name: Build with Maven - name: Build with Maven
run: mvn clean package # Clean and package your Maven project run: mvn -B package --file pom.xml
# Build your project using Maven in non-interactive mode and specify the POM file.
- name: Run tests with Maven - name: Run tests with Maven
run: mvn test # Run tests using Maven run: mvn -B test --file pom.xml
# Run tests using Maven in non-interactive mode and specify the POM file.
# Store build artifacts for history # Store build artifacts for history
- name: Archive Build Artifacts - 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: with:
name: build-artifacts # Name for the uploaded artifacts name: build-artifacts # Name for the uploaded artifacts
path: 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 # Static Code Analysis with Checkstyle
- name: Static Code Analysis with Checkstyle - name: Static Code Analysis with Checkstyle
run: | run: |
# Install and run Checkstyle # Install and run Checkstyle
mvn org.apache.maven.plugins:maven-checkstyle-plugin:3.1.1:checkstyle mvn org.apache.maven.plugins:maven-checkstyle-plugin:3.1.1:checkstyle
# Run Checkstyle # Run Checkstyle using Maven.
mvn checkstyle:check mvn checkstyle:check
# Store static code analysis reports # Store static code analysis reports
@ -48,7 +50,7 @@ jobs:
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: static-code-analysis-reports name: static-code-analysis-reports
path: target/checkstyle-result.xml path: target/checkstyle-result.xml # Path to the Checkstyle report.
# Code Coverage # Code Coverage
- name: Code Coverage - name: Code Coverage
@ -61,4 +63,4 @@ jobs:
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: code-coverage-reports name: code-coverage-reports
path: target/site/jacoco/ path: target/site/jacoco/ # Path to the code coverage report.