|
68 | 68 | if: ${{ steps.check-image.outputs.is_skipped != 'true' }}
|
69 | 69 | run: yarn run build --continue --affected
|
70 | 70 |
|
| 71 | + - name: Install SealLight |
| 72 | + if: ${{ steps.check-image.outputs.is_skipped != 'true' }} |
| 73 | + run: yarn add -D slnodejs |
| 74 | + |
| 75 | + - name: Configure SealLight |
| 76 | + if: ${{ steps.check-image.outputs.is_skipped != 'true' }} |
| 77 | + run: npx slnodejs config --token $SL_TOKEN --appname "rhdh" --branch "pr-${{ github.event.pull_request.number }}-${{ github.head_ref }}" --build "pr-${{ github.event.pull_request.number }}-${{ github.sha }}" |
| 78 | + |
| 79 | + - name: Extract backend bundle for SealLight scan |
| 80 | + if: ${{ steps.check-image.outputs.is_skipped != 'true' }} |
| 81 | + run: tar -xzf packages/backend/dist/bundle.tar.gz -C packages/backend/dist |
| 82 | + |
| 83 | + - name: Scan all packages with SealLight |
| 84 | + if: ${{ steps.check-image.outputs.is_skipped != 'true' }} |
| 85 | + run: | |
| 86 | + # Define scan targets: workspace_path:module_id |
| 87 | + scan_targets=( |
| 88 | + "plugins/dynamic-plugins-info-backend:dynamic-plugins-info-backend" |
| 89 | + "plugins/scalprum-backend:scalprum-backend" |
| 90 | + "plugins/licensed-users-info-backend:licensed-users-info-backend" |
| 91 | + "plugins/dynamic-plugins-info:dynamic-plugins-info" |
| 92 | + "packages/app:app" |
| 93 | + "packages/backend/dist/bundle/packages/backend/dist:backend" |
| 94 | + "packages/app-next:app-next" |
| 95 | + "packages/plugin-utils:plugin-utils" |
| 96 | + ) |
| 97 | + |
| 98 | + # Common scan parameters |
| 99 | + common_params="--token $SL_TOKEN --buildsessionidFile ./buildsessionid --scm none --projectroot ${{ github.workspace }}" |
| 100 | + |
| 101 | + # Scan each target |
| 102 | + for target in "${scan_targets[@]}"; do |
| 103 | + workspace_path="${target%:*}" |
| 104 | + module_id="${target#*:}" |
| 105 | + echo "Scanning $module_id at $workspace_path" |
| 106 | + npx slnodejs scan $common_params --workspacepath "${{ github.workspace }}/$workspace_path" --uniqueModuleId "$module_id" |
| 107 | + done |
| 108 | +
|
| 109 | + - name: End SealLight build session |
| 110 | + if: ${{ steps.check-image.outputs.is_skipped != 'true' }} |
| 111 | + run: npx slnodejs buildend --token $SL_TOKEN --buildsessionidFile ./buildsessionid --ok |
| 112 | + |
71 | 113 | test:
|
72 | 114 | name: Test with Node.js ${{ matrix.node-version }}
|
73 | 115 | runs-on: ubuntu-latest
|
@@ -125,10 +167,39 @@ jobs:
|
125 | 167 | echo "ERROR: Workspace is dirty! Must run 'yarn build:dockerfile' and commit changes!"; exit 1; \
|
126 | 168 | fi
|
127 | 169 |
|
| 170 | + - name: Install SealLight |
| 171 | + if: ${{ steps.check-image.outputs.is_skipped != 'true' }} |
| 172 | + run: yarn add -D slnodejs |
| 173 | + |
| 174 | + - name: Configure SealLight |
| 175 | + if: ${{ steps.check-image.outputs.is_skipped != 'true' }} |
| 176 | + run: npx slnodejs config --token $SL_TOKEN --appname "rhdh" --branch "pr-${{ github.event.pull_request.number }}-${{ github.head_ref }}" --build "pr-${{ github.event.pull_request.number }}-${{ github.sha }}" |
| 177 | + |
| 178 | + - name: Start SealLight test stage |
| 179 | + if: ${{ steps.check-image.outputs.is_skipped != 'true' }} |
| 180 | + run: npx slnodejs start --token $SL_TOKEN --labid $RHDHLABID --teststage "Unit Tests" |
| 181 | + |
128 | 182 | - name: Run tests
|
129 | 183 | if: ${{ steps.check-image.outputs.is_skipped != 'true' }}
|
130 | 184 | run: yarn run test --continue --affected
|
131 | 185 |
|
| 186 | + - name: Upload JUnit XML report to SealLight |
| 187 | + if: ${{ steps.check-image.outputs.is_skipped != 'true' }} |
| 188 | + run: npx slnodejs uploadReports --token $SL_TOKEN --labid $RHDHLABID --reportFile "./jest-junit-results/junit.xml" |
| 189 | + |
| 190 | + - name: Upload coverage reports to SealLight |
| 191 | + if: ${{ steps.check-image.outputs.is_skipped != 'true' }} |
| 192 | + run: | |
| 193 | + # Upload coverage reports from all packages |
| 194 | + find . -name "coverage-final.json" -path "*/coverage/*" | while read coverage_file; do |
| 195 | + echo "Uploading coverage report: $coverage_file" |
| 196 | + npx slnodejs nycReport --token $SL_TOKEN --labid $RHDHLABID --report "$coverage_file" |
| 197 | + done |
| 198 | +
|
| 199 | + - name: End SealLight test stage |
| 200 | + if: ${{ steps.check-image.outputs.is_skipped != 'true' }} |
| 201 | + run: npx slnodejs end --token $SL_TOKEN --labid $RHDHLABID |
| 202 | + |
132 | 203 | - name: Install dynamic plugin dependencies
|
133 | 204 | if: ${{ steps.check-image.outputs.is_skipped != 'true' }}
|
134 | 205 | run: cd ./dynamic-plugins && yarn install && cd ..
|
|
0 commit comments