diff --git a/.github/workflows/badges.yml b/.github/workflows/badges.yml deleted file mode 100644 index a5c5bb4..0000000 --- a/.github/workflows/badges.yml +++ /dev/null @@ -1,85 +0,0 @@ -# For more information see: https://docs.github.com/en/actions/ - -name: Badges CI - -on: - push: - branches: ['main'] - paths: ['**.java', '.github/workflows/build.yml', 'pom.xml'] - pull_request: - branches: ['main'] - workflow_dispatch: - -env: - JAVA: '11' - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Checkout badges branch to a badges directory nested inside first checkout - uses: actions/checkout@v4 - with: - ref: badges - path: badges - - - name: Set up JDK ${{ env.JAVA }} - uses: actions/setup-java@v4 - with: - java-version: ${{ env.JAVA }} - distribution: 'temurin' - cache: maven - - - name: Build backend - run: ./mvnw -B clean package -Pprod -Dmaven.test.skip=true -Darguments="-DskipTests" - - - name: Tests backend - run: ./mvnw test -Ptest - - - name: Generate JaCoCo badge - id: jacoco - uses: cicirello/jacoco-badge-generator@v2 - with: - badges-directory: badges - generate-branches-badge: true - generate-summary: true - - - name: Log coverage percentages to workflow output - run: | - echo "coverage = ${{ steps.jacoco.outputs.coverage }}" - echo "branches = ${{ steps.jacoco.outputs.branches }}" - - - name: Upload JaCoCo coverage report as a workflow artifact - uses: actions/upload-artifact@v4 - with: - name: jacoco-report - path: target/site/jacoco/ - - - name: Commit and push the coverage badges and summary file - if: ${{ github.event_name != 'pull_request' }} - run: | - cd badges - if [[ `git status --porcelain *.svg *.json` ]]; then - git config --global user.name 'github-actions' - git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' - git add *.svg *.json - git commit -m "Autogenerated JaCoCo coverage badges" *.svg *.json - git push - fi - - - name: Comment on PR with coverage percentages - if: ${{ github.event_name == 'pull_request' }} - run: | - REPORT=$(