Merge pull request #21 from sumeet-srknec/sumeet-srknec-patch-1 #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: backend-ci | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- "demo/**" | |
- ".github/workflows/actions/action.yaml" | |
- ".github/workflows/backend-ci.yml" | |
- "pom.xml" | |
pull_request: | |
branches: [ "main" ] | |
paths: | |
- "demo/**" | |
- ".github/workflows/actions/action.yaml" | |
- ".github/workflows/backend-ci.yml" | |
- "pom.xml" | |
workflow_dispatch: | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
env: | |
FROM_ORIGINAL_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.ref == 'refs/heads/main' }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- uses: ./.github/workflows/actions | |
- name: Run Maven Build Command | |
run: cd demo ; mvn clean install -DskipTests | |
- name: OWASP Dependency Check | |
uses: dependency-check/Dependency-Check_Action@main | |
env: | |
JAVA_HOME: /opt/jdk | |
with: | |
project: 'spring-elastic-redis' | |
path: '.' | |
format: 'HTML' | |
- name: Upload OWASP Dependency Check results | |
uses: actions/upload-artifact@master | |
with: | |
name: OWASP Dependency Check Report | |
path: ${{github.workspace}}/reports | |
- name: Add coverage report to PR | |
uses: madrapps/[email protected] | |
if: ${{ env.FROM_ORIGINAL_REPOSITORY == 'true' }} | |
with: | |
paths: ${{github.workspace}}/demo/target/site/jacoco/jacoco.xml | |
token: ${{secrets.GITHUB_TOKEN}} | |
min-coverage-overall: 80 | |
min-coverage-changed-files: 60 | |
title: 'Demo Coverage Report' | |
update-comment: true |