Skip to content

Commit 31680c0

Browse files
committed
Fix sonar cannot work
1 parent 2db8098 commit 31680c0

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

.github/workflows/unit-test.yml

+14-18
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ on:
2626
branches:
2727
- '[0-9]+.[0-9]+.[0-9]+-prepare'
2828
- '[0-9]+.[0-9]+.[0-9]+-release'
29+
- dev
30+
pull_request_target:
31+
paths:
32+
- '**/pom.xml'
2933

3034
env:
3135
LOG_DIR: /tmp/dolphinscheduler
@@ -35,6 +39,10 @@ concurrency:
3539
cancel-in-progress: true
3640

3741
jobs:
42+
build:
43+
permissions:
44+
contents: read
45+
pull-requests: write
3846
paths-filter:
3947
name: Unit-Test-Path-Filter
4048
runs-on: ubuntu-latest
@@ -79,20 +87,7 @@ jobs:
7987
run: ./mvnw clean verify -B -Dmaven.test.skip=false -Dspotless.skip=true -DskipUT=false
8088
- name: Upload coverage report to codecov
8189
run: CODECOV_TOKEN="09c2663f-b091-4258-8a47-c981827eb29a" bash <(curl -s https://codecov.io/bash)
82-
sonarcloud-analysis:
83-
name: SonarCloud-Analysis
84-
needs: paths-filter
85-
runs-on: ubuntu-latest
86-
timeout-minutes: 30
87-
steps:
88-
- uses: actions/checkout@v4
89-
with:
90-
submodules: true
91-
- uses: actions/cache@v4
92-
with:
93-
path: ~/.m2/repository
94-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-unit-test
95-
restore-keys: ${{ runner.os }}-maven-
90+
9691
# Set up JDK 17 for SonarCloud.
9792
- name: Set up JDK 17
9893
uses: actions/setup-java@v2
@@ -110,8 +105,9 @@ jobs:
110105
-Dsonar.core.codeCoveragePlugin=jacoco
111106
-Dsonar.projectKey=apache-dolphinscheduler
112107
-Dsonar.exclusions=,dolphinscheduler-ui/src/**/i18n/locale/*.js,dolphinscheduler-microbench/src/**/*
113-
-Dsonar.token=e4058004bc6be89decf558ac819aa1ecbee57682
114-
-Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
108+
-Dhttp.keepAlive=false
109+
-Dmaven.wagon.http.pool=false
110+
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120
115111
-DskipUT=true
116112
env:
117113
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -120,7 +116,7 @@ jobs:
120116
name: Unit Test
121117
runs-on: ubuntu-latest
122118
timeout-minutes: 30
123-
needs: [ unit-test, paths-filter, sonarcloud-analysis ]
119+
needs: [ unit-test, paths-filter ]
124120
if: always()
125121
steps:
126122
- name: Status
@@ -129,7 +125,7 @@ jobs:
129125
echo "Skip Unit Test!"
130126
exit 0
131127
fi
132-
if [[ ${{ needs.unit-test.result }} != 'success' || ${{ needs.sonarcloud-analysis.result }} != 'success' ]]; then
128+
if [[ ${{ needs.unit-test.result }} != 'success' ]]; then
133129
echo "Unit Test Failed!"
134130
exit -1
135131
fi

pom.xml

+3
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,9 @@
642642
<goals>
643643
<goal>restore-instrumented-classes</goal>
644644
</goals>
645+
<configuration>
646+
<excludes>com/github/dreamhead/moco/*</excludes>
647+
</configuration>
645648
</execution>
646649
<execution>
647650
<id>default-report</id>

0 commit comments

Comments
 (0)