97
97
if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
98
98
run : |
99
99
echo "${SL_TOKEN}" > sltoken.txt
100
- echo "Token last 7 chars: ...${SL_TOKEN: -7}"
100
+ echo "Token last 7 chars : ...${SL_TOKEN: -7}"
101
101
env :
102
102
SL_TOKEN : ' ${{secrets.SL_TOKEN}}'
103
103
@@ -111,6 +111,8 @@ jobs:
111
111
112
112
- name : Scan all packages with SealLight
113
113
if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
114
+ env :
115
+ NODE_DEBUG : sl
114
116
run : |
115
117
# Define scan targets: workspace_path:module_id
116
118
scan_targets=(
@@ -125,19 +127,47 @@ jobs:
125
127
)
126
128
127
129
# Common scan parameters
128
- common_params="--tokenfile ./sltoken.txt --buildsessionidFile ./buildsessionid --scm none --projectroot ${{ github.workspace }}"
130
+ common_params="--tokenfile ./sltoken.txt --buildsessionidFile ./buildSessionId --scm none --projectroot ${{ github.workspace }}"
131
+
132
+ # Verify build session file exists
133
+ if [[ ! -f ./buildSessionId ]]; then
134
+ echo "Error: buildsessionid file not found. SealLight session may not be properly initialized."
135
+ exit 1
136
+ fi
129
137
130
138
# Scan each target
131
139
for target in "${scan_targets[@]}"; do
132
140
workspace_path="${target%:*}"
133
141
module_id="${target#*:}"
142
+ full_path="${{ github.workspace }}/$workspace_path"
143
+
134
144
echo "Scanning $module_id at $workspace_path"
135
- npx slnodejs scan $common_params --workspacepath "${{ github.workspace }}/$workspace_path" --uniqueModuleId "$module_id"
145
+ echo "Full path: $full_path"
146
+
147
+ # Verify the path exists
148
+ if [[ ! -d "$full_path" ]]; then
149
+ echo "Warning: Directory $full_path does not exist, skipping scan for $module_id"
150
+ continue
151
+ fi
152
+
153
+ # Run the scan with error handling
154
+ if ! npx slnodejs scan $common_params --workspacepath "$full_path" --uniqueModuleId "$module_id"; then
155
+ echo "Error: SealLight scan failed for $module_id at $full_path"
156
+ echo "Continuing with other scans..."
157
+ continue
158
+ fi
159
+
160
+ echo "Successfully scanned $module_id"
136
161
done
137
162
138
163
- name : End SealLight build session
139
- if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
140
- run : npx slnodejs buildend --tokenfile ./sltoken.txt --buildsessionidFile ./buildsessionid --ok
164
+ if : ${{ steps.check-image.outputs.is_skipped != 'true' && always() }}
165
+ run : |
166
+ if [[ -f ./buildSessionId ]]; then
167
+ npx slnodejs buildend --tokenfile ./sltoken.txt --buildsessionidFile ./buildSessionId --ok
168
+ else
169
+ echo "Warning: buildSessionId file not found, cannot end SealLight session"
170
+ fi
141
171
142
172
test :
143
173
name : Test with Node.js ${{ matrix.node-version }}
@@ -215,28 +245,28 @@ jobs:
215
245
216
246
- name : Start SealLight test stage
217
247
if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
218
- run : npx slnodejs start --tokenfile ./sltoken.txt --buildsessionidFile ./buildsessionid --teststage "Unit Tests"
248
+ run : npx slnodejs start --tokenfile ./sltoken.txt --buildsessionidFile ./buildSessionId --teststage "Unit Tests"
219
249
220
250
- name : Run tests
221
251
if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
222
252
run : yarn run test --continue --affected
223
253
224
254
- name : Upload JUnit XML report to SealLight
225
255
if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
226
- run : npx slnodejs uploadReports --tokenfile ./sltoken.txt --buildsessionidFile ./buildsessionid --reportFile "./jest-junit-results/junit.xml"
256
+ run : npx slnodejs uploadReports --tokenfile ./sltoken.txt --buildsessionidFile ./buildSessionId --reportFile "./jest-junit-results/junit.xml"
227
257
228
258
- name : Upload coverage reports to SealLight
229
259
if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
230
260
run : |
231
261
# Upload coverage reports from all packages
232
262
find . -name "coverage-final.json" -path "*/coverage/*" | while read coverage_file; do
233
263
echo "Uploading coverage report: $coverage_file"
234
- npx slnodejs nycReport --tokenfile ./sltoken.txt --buildsessionidFile ./buildsessionid --report "$coverage_file"
264
+ npx slnodejs nycReport --tokenfile ./sltoken.txt --buildsessionidFile ./buildSessionId --report "$coverage_file"
235
265
done
236
266
237
267
- name : End SealLight test stage
238
268
if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
239
- run : npx slnodejs end --tokenfile ./sltoken.txt --buildsessionidFile ./buildsessionid
269
+ run : npx slnodejs end --tokenfile ./sltoken.txt --buildsessionidFile ./buildSessionId
240
270
- name : Install dynamic plugin dependencies
241
271
if : ${{ steps.check-image.outputs.is_skipped != 'true' }}
242
272
run : cd ./dynamic-plugins && yarn install && cd ..
0 commit comments