Skip to content

[83] BE: notifications #62

[83] BE: notifications

[83] BE: notifications #62

Workflow file for this run

name: CI for Backend
on:
pull_request:
branches:
- master
- develop
paths:
- 'backend/**'
jobs:
ci:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 21
distribution: 'adopt'
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Run Gradle tests
run: ./gradlew test --no-daemon
- name: Generate JaCoCo Report and run Sonar Analysis
run: ./gradlew jacocoTestReport sonar --no-daemon
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Generate JaCoCo Badge
uses: cicirello/jacoco-badge-generator@v2
with:
generate-branches-badge: true
jacoco-csv-file: backend/build/reports/jacoco/test/jacocoTestReport.csv