Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4

[*.java]
indent_size = 4
max_line_length = 120
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* text=auto
*.java text
*.sh text eol=lf
*.bat text eol=crlf
28 changes: 28 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
### Summary

Briefly describe what this PR does and why.

### Details

Add more context about the changes:

- What was changed?
- Why was it changed?
- Any trade-offs or known limitations?

Screenshots, GIFs, or videos are welcome if this affects UI/UX.

### How to Test

Describe how reviewers can test the changes:

1. Step one
2. Step two
3. Expected result

### Checklist

- [ ] Changes have been tested locally
- [ ] Logic is complete at 100%
- [ ] Design/UI is complete at 100%
- [ ] No breaking changes (or they are documented)
57 changes: 13 additions & 44 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,24 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven
name: Java CI

on:
push:
branches: [ "master" ] # Trigger the action on push to the master branch
branches: ["master"]
pull_request:
branches: [ "master" ] # Trigger the action on pull requests targeting the master branch
branches: ["master"]

jobs:
build:
runs-on: ubuntu-latest # Use the latest version of Ubuntu for the build environment
runs-on: ubuntu-latest

steps:
# Step 1: Check out the code from the repository
- name: Check out code
uses: actions/checkout@v4

# Step 2: Set up JDK 21
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin' # Use the Temurin distribution for OpenJDK
cache: maven # Cache Maven dependencies to speed up subsequent builds

# Step 3: Clean and build with Maven
- name: Build with Maven
run: mvn -B clean package --file pom.xml # Build the project with Maven, suppress the interactive mode

# Step 4: Run Tests
# - name: Run Tests
# run: mvn test --file pom.xml # Run the tests to ensure the code works as expected

# # Step 5: Upload the built JAR file as an artifact
# - name: Upload JAR Artifact
# uses: actions/upload-artifact@v4
# with:
# name: backupmanager-jar # Name of the artifact
# path: target/BackupManager-1.0-SNAPSHOT-jar-with-dependencies.jar # Path to the JAR file
- uses: actions/checkout@v4

# # Step 6: Static Code Analysis with SpotBugs (optional)
- name: Static Code Analysis with SpotBugs
run: mvn com.github.spotbugs:spotbugs-maven-plugin:spotbugs # Run SpotBugs for static code analysis
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: maven

# # Step 7: Update dependency graph to improve Dependabot alerts
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 # Submit dependency graph for security monitoring
- name: Build + Quality (skip tests)
run: mvn -B clean verify -DskipTests=true
3 changes: 3 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
wrapperVersion=3.3.4
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
382 changes: 382 additions & 0 deletions .vscode/java-formatter.xml

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
}
"java.configuration.updateBuildConfiguration": "interactive",
"java.format.settings.url": ".vscode/java-formatter.xml"
}
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ $\rightarrow$ [Code tecnical documentation](./docs/code_documentation.md)
| German | ✅ |
| French | ✅ |

## Code Quality

This project enforces automatic code quality checks during the Maven verify phase.
Running the following command will execute formatting checks, static analysis, and tests:

`mvn clean verify`

If any rule is violated, the build will fail.

## Licence

[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)
Expand Down
Loading