@@ -17,38 +17,24 @@ concurrency:
1717 group : ${{ github.workflow }}-${{ github.ref }}
1818 cancel-in-progress : true
1919
20- permissions :
21- contents : read
22- pull-requests : write
23- issues : write
24-
2520env :
2621 MAVEN_OPTS : ' -Xmx4G -Xms1G -XX:+ClassUnloadingWithConcurrentMark -Djava.security.egd=file:/dev/./urandom'
2722 MAVEN_CLI_OPTS : ' -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
2823
2924jobs :
30- # Notify build started (for PRs)
31- notify-start :
32- if : github.event_name == 'pull_request'
33- runs-on : ubuntu-latest
34- steps :
35- - name : Post PR comment
36- uses : actions/github-script@v7
37- with :
38- script : |
39- github.rest.issues.createComment({
40- owner: context.repo.owner,
41- repo: context.repo.repo,
42- issue_number: context.issue.number,
43- body: `🚀 Build started! [View workflow run](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId})`
44- })
45-
4625 # Incremental build for PRs
4726 incremental-build :
4827 if : github.event_name == 'pull_request'
4928 runs-on : ubuntu-latest
5029 timeout-minutes : 180
5130 steps :
31+ - name : Free disk space
32+ run : |
33+ sudo rm -rf /usr/share/dotnet
34+ sudo rm -rf /usr/local/lib/android
35+ sudo rm -rf /opt/ghc
36+ df -h
37+
5238 - name : Checkout
5339 uses : actions/checkout@v4
5440 with :
7763 runs-on : ubuntu-latest
7864 timeout-minutes : 180
7965 steps :
66+ - name : Free disk space
67+ run : |
68+ sudo rm -rf /usr/share/dotnet
69+ sudo rm -rf /usr/local/lib/android
70+ sudo rm -rf /opt/ghc
71+ df -h
72+
8073 - name : Checkout
8174 uses : actions/checkout@v4
8275
@@ -104,6 +97,13 @@ jobs:
10497 runs-on : ubuntu-latest
10598 timeout-minutes : 60
10699 steps :
100+ - name : Free disk space
101+ run : |
102+ sudo rm -rf /usr/share/dotnet
103+ sudo rm -rf /usr/local/lib/android
104+ sudo rm -rf /opt/ghc
105+ df -h
106+
107107 - name : Checkout
108108 uses : actions/checkout@v4
109109
@@ -252,45 +252,23 @@ jobs:
252252 -DskipTests=true \
253253 -DretryFailedDeploymentCount=10
254254
255- # Final status notification
256- notify-result :
257- needs : [incremental-build, full-build, integration-tests , dependency-check]
258- if : always()
255+ # Slack notification (non-PR builds only)
256+ notify-slack :
257+ needs : [full-build, dependency-check]
258+ if : always() && github.event_name != 'pull_request'
259259 runs-on : ubuntu-latest
260260 steps :
261261 - name : Determine build result
262262 id : result
263263 run : |
264- # Check for failures (skipped jobs are OK)
265- FAILED=false
266- if [[ "${{ needs.incremental-build.result }}" == "failure" ]]; then FAILED=true; fi
267- if [[ "${{ needs.full-build.result }}" == "failure" ]]; then FAILED=true; fi
268- if [[ "${{ needs.integration-tests.result }}" == "failure" ]]; then FAILED=true; fi
269- if [[ "${{ needs.dependency-check.result }}" == "failure" ]]; then FAILED=true; fi
270-
271- if [[ "$FAILED" == "true" ]]; then
264+ if [[ "${{ needs.full-build.result }}" == "failure" ]] || \
265+ [[ "${{ needs.dependency-check.result }}" == "failure" ]]; then
272266 echo "status=failure" >> $GITHUB_OUTPUT
273267 else
274268 echo "status=success" >> $GITHUB_OUTPUT
275269 fi
276270
277- - name : Post PR comment with result
278- if : github.event_name == 'pull_request'
279- uses : actions/github-script@v7
280- with :
281- script : |
282- const status = '${{ steps.result.outputs.status }}';
283- const emoji = status === 'success' ? '✅' : '❌';
284- const message = status === 'success' ? 'Build succeeded!' : 'Build failed.';
285- github.rest.issues.createComment({
286- owner: context.repo.owner,
287- repo: context.repo.repo,
288- issue_number: context.issue.number,
289- body: `${emoji} ${message} [View workflow run](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId})`
290- })
291-
292271 - name : Slack notification
293- if : github.event_name != 'pull_request'
294272 uses : slackapi/slack-github-action@v1.26.0
295273 with :
296274 payload : |
0 commit comments