@@ -17,6 +17,28 @@ permissions:
1717 contents : read
1818
1919jobs :
20+ init :
21+ name : initialize
22+ runs-on : ubuntu-24.04
23+ outputs :
24+ run-privileged-jobs : ${{ steps.vars.outputs.run-privileged-jobs }}
25+ strong-name-key-filename : ${{ steps.vars.outputs.strong-name-key-filename }}
26+ build-switches : ${{ steps.vars.outputs.build-switches }}
27+ steps :
28+ - id : vars
29+ name : calculate workflow variables
30+ shell : bash
31+ run : |
32+ if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]]; then
33+ echo "run-privileged-jobs=false" >> "$GITHUB_OUTPUT"
34+ echo "strong-name-key-filename=" >> "$GITHUB_OUTPUT"
35+ echo "build-switches=-p:SkipSignAssembly=true" >> "$GITHUB_OUTPUT"
36+ else
37+ echo "run-privileged-jobs=true" >> "$GITHUB_OUTPUT"
38+ echo "strong-name-key-filename=savvyio.snk" >> "$GITHUB_OUTPUT"
39+ echo "build-switches=" >> "$GITHUB_OUTPUT"
40+ fi
41+
2042 prepare_test :
2143 name : 📜 Prepare Test
2244 runs-on : ubuntu-24.04
4365
4466 build :
4567 name : call-build
68+ needs : [init]
4669 strategy :
4770 matrix :
4871 arch : [X64, ARM64]
5174 with :
5275 runs-on : ${{ matrix.arch == 'ARM64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
5376 configuration : ${{ matrix.configuration }}
54- strong-name-key-filename : savvyio.snk
77+ strong-name-key-filename : ${{ needs.init.outputs.strong-name-key-filename }}
78+ build-switches : ${{ needs.init.outputs.build-switches }}
5579 upload-build-artifact-name : build-${{ matrix.configuration }}-${{ matrix.arch }}
5680 secrets : inherit
5781
@@ -106,8 +130,9 @@ jobs:
106130 download-pattern : build-${{ matrix.configuration }}-${{ matrix.arch }}
107131
108132 integration_test :
133+ if : ${{ needs.init.outputs.run-privileged-jobs == 'true' }}
109134 name : ⚗️ Integration Test - Azure and AWS
110- needs : [build]
135+ needs : [init, build]
111136 strategy :
112137 fail-fast : false
113138 matrix :
@@ -213,8 +238,9 @@ jobs:
213238 docker rm nats
214239
215240 sonarcloud :
241+ if : ${{ needs.init.outputs.run-privileged-jobs == 'true' }}
216242 name : call-sonarcloud
217- needs : [build, test_linux, test_windows, integration_test, integration_test_rabbitmq, integration_test_nats]
243+ needs : [init, build, test_linux, test_windows, integration_test, integration_test_rabbitmq, integration_test_nats]
218244 uses : codebeltnet/jobs-sonarcloud/.github/workflows/default.yml@v3
219245 with :
220246 organization : geekle
@@ -223,16 +249,18 @@ jobs:
223249 secrets : inherit
224250
225251 codecov :
252+ if : ${{ needs.init.outputs.run-privileged-jobs == 'true' }}
226253 name : call-codecov
227- needs : [build, test_linux, test_windows, integration_test, integration_test_rabbitmq, integration_test_nats]
254+ needs : [init, build, test_linux, test_windows, integration_test, integration_test_rabbitmq, integration_test_nats]
228255 uses : codebeltnet/jobs-codecov/.github/workflows/default.yml@v1
229256 with :
230257 repository : codebeltnet/savvyio
231258 secrets : inherit
232259
233260 codeql :
261+ if : ${{ needs.init.outputs.run-privileged-jobs == 'true' }}
234262 name : call-codeql
235- needs : [build, test_linux, test_windows, integration_test, integration_test_rabbitmq, integration_test_nats]
263+ needs : [init, build, test_linux, test_windows, integration_test, integration_test_rabbitmq, integration_test_nats]
236264 uses : codebeltnet/jobs-codeql/.github/workflows/default.yml@v3
237265 permissions :
238266 security-events : write
@@ -241,7 +269,7 @@ jobs:
241269 if : github.event_name != 'pull_request'
242270 name : call-nuget
243271 needs : [build, pack, test_linux, test_windows, integration_test, integration_test_rabbitmq, integration_test_nats, sonarcloud, codecov, codeql]
244- uses : codebeltnet/jobs-nuget-push/.github/workflows/default.yml@v2
272+ uses : codebeltnet/jobs-nuget-push/.github/workflows/default.yml@v3
245273 with :
246274 version : ${{ needs.build.outputs.version }}
247275 environment : Production
0 commit comments