diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 6eae019e..3d23fc76 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,16 +7,21 @@ assignees: '' --- **Describe the bug** + A clear and concise description of what the bug is. **To Reproduce** + Steps to reproduce the behavior: **Expected behavior** + A clear and concise description of what you expected to happen. **Screenshots** + If applicable, add screenshots to help explain your problem. **Additional context** + Add any other context about the problem here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/dev_task.md b/.github/ISSUE_TEMPLATE/dev_task.md index 26ebb3fd..d8515fe5 100644 --- a/.github/ISSUE_TEMPLATE/dev_task.md +++ b/.github/ISSUE_TEMPLATE/dev_task.md @@ -9,15 +9,19 @@ assignees: '' # Dev task **Description** + Briefly describe the feature or improvement. **Related user story:** Please include link to the related user story here. **Motivation** + Why is this useful? What problem does it solve? **Estimate** + The estimation of how long will this user story take. **Additional context** + Add any other context or screenshots about the feature request here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/user_story.md b/.github/ISSUE_TEMPLATE/user_story.md index c58922ed..0a6b1ecd 100644 --- a/.github/ISSUE_TEMPLATE/user_story.md +++ b/.github/ISSUE_TEMPLATE/user_story.md @@ -9,6 +9,7 @@ assignees: '' # User story ## Description + Please describe the user story here. **Estimate:** The estimation of how long this user story takes. diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml new file mode 100644 index 00000000..4f46ca61 --- /dev/null +++ b/.github/workflows/code_coverage.yml @@ -0,0 +1,30 @@ +name: Workflow for Codecov example-java-gradle + +on: + push: + branches: [ "main" , "dev" ] + pull_request: + +permissions: + contents: read + pull-requests: write + +jobs: + run: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + + - name: Install dependencies, run tests, and collect coverage + run: gradle build + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 diff --git a/.github/workflows/dev-to-main-only.yml b/.github/workflows/dev-to-main-only.yml new file mode 100644 index 00000000..cc05da1f --- /dev/null +++ b/.github/workflows/dev-to-main-only.yml @@ -0,0 +1,23 @@ + +name: Allow only dev to merge into main + +on: + pull_request: + branches: + - main + +jobs: + validate-source-branch: + runs-on: ubuntu-latest + steps: + - name: Check source branch + run: | + echo "Base branch: ${{ github.event.pull_request.base.ref }}" + echo "Head branch: ${{ github.event.pull_request.head.ref }}" + + if [ "${{ github.event.pull_request.head.ref }}" != "dev" ]; then + echo "Only dev branch is allowed to merge into main" + exit 1 + fi + + echo "dev branch detected, merge allowed" diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 0752b9ef..ee1b8749 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -2,7 +2,7 @@ name: Build Docker Image on: push: - branches: [ "main" ] + branches: [ "main" , "dev" ] pull_request: jobs: diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 028c4b60..37975364 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -6,7 +6,7 @@ permissions: on: push: - branches: [ "main" ] + branches: [ "main" , "dev"] pull_request: jobs: diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 15fc1bc3..b812414b 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -2,7 +2,7 @@ name: Gradle Build on: push: - branches: [ "main" ] + branches: [ "main" , "dev" ] pull_request: jobs: diff --git a/.github/workflows/unit-testing.yml b/.github/workflows/unit-testing.yml index 66c95640..98aa6215 100644 --- a/.github/workflows/unit-testing.yml +++ b/.github/workflows/unit-testing.yml @@ -2,7 +2,7 @@ name: Unit test on: push: - branches: [ "main" ] + branches: [ "main" , "dev" ] pull_request: jobs: diff --git a/build.gradle b/build.gradle index 1c932c8a..3587cd24 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ plugins { id 'java' id 'org.springframework.boot' version '4.0.1' id 'io.spring.dependency-management' version '1.1.7' + id 'jacoco' } group = 'com.backend' @@ -26,4 +27,18 @@ dependencies { tasks.named('test') { useJUnitPlatform() + finalizedBy jacocoTestReport +} + +jacoco { + toolVersion = "0.8.11" +} + +jacocoTestReport { + dependsOn test + reports { + xml.required = true + html.required = true + csv.required = false + } }