|
1 |
| -name: "Backend: build and test" |
| 1 | +name: "Backend: tests & sonar" |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | workflow_call:
|
@@ -30,40 +30,12 @@ jobs:
|
30 | 30 | with:
|
31 | 31 | java-version: '21'
|
32 | 32 | distribution: 'zulu'
|
33 |
| - cache: 'maven' |
| 33 | + cache: 'gradle' |
34 | 34 |
|
35 |
| - - name: Cache SonarCloud packages |
36 |
| - uses: actions/cache@v4 |
37 |
| - with: |
38 |
| - path: ~/.sonar/cache |
39 |
| - key: ${{ runner.os }}-sonar |
40 |
| - restore-keys: ${{ runner.os }}-sonar |
41 |
| - |
42 |
| - - name: "Pull request: Maven tests & sonar" |
43 |
| - if: ${{ inputs.event_name == 'pull_request' || inputs.event_name == 'pull_request_target' }} |
44 |
| - env: |
45 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
46 |
| - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND }} |
47 |
| - HEAD_REF: ${{ github.head_ref }} |
48 |
| - BASE_REF: ${{ github.base_ref }} |
49 |
| - SKIP_SONAR: "true" # TODO remove when public |
| 35 | + - name: "Tests" |
50 | 36 | run: |
|
51 |
| - ./mvnw -B -ntp versions:set -DnewVersion=${{ github.event.pull_request.head.sha }} |
52 |
| - ./mvnw -B -V -ntp verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ |
53 |
| - -Dsonar.skip=${SKIP_SONAR} \ |
54 |
| - -Dsonar.projectKey=io.kafbat:kafbat-ui_backend \ |
55 |
| - -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \ |
56 |
| - -Dsonar.pullrequest.branch=$HEAD_REF \ |
57 |
| - -Dsonar.pullrequest.base=$BASE_REF |
| 37 | + ./gradlew :api:test --info |
58 | 38 |
|
59 |
| - - name: "Main: Maven tests & sonar" |
60 |
| - if: ${{ inputs.event_name == 'push' }} |
61 |
| - env: |
62 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
63 |
| - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND }} |
64 |
| - SKIP_SONAR: "true" # TODO remove when public |
| 39 | + - name: "Sonar" |
65 | 40 | run: |
|
66 |
| - ./mvnw -B -ntp versions:set -DnewVersion=$GITHUB_SHA |
67 |
| - ./mvnw -B -V -ntp verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ |
68 |
| - -Dsonar.skip=${SKIP_SONAR} \ |
69 |
| - -Dsonar.projectKey=io.kafbat:kafbat-ui_backend |
| 41 | + ./gradlew sonar --info |
0 commit comments