[83] BE: notifications #59
Workflow file for this run
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: 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 |