@@ -345,14 +345,121 @@ jobs:
345345
346346 reuseable-ci-checks-code-coverage :
347347 name : Check for code coverage
348+ timeout-minutes : 60
348349 runs-on : ubuntu-latest
349350 if : success() || failure()
350351 continue-on-error : ${{ inputs.runall }}
351352 outputs :
352353 status : ${{ job.status }}
353354 steps :
354- - name : See other project pipeline for Tests
355- run : echo " See other project pipeline for Tests this is a placeholder"
355+ - name : Checkout code
356+ uses : actions/checkout@v3
357+
358+ - name : Setup .NET
359+ uses : actions/setup-dotnet@v4
360+ with :
361+ global-json-file : global.json
362+
363+ - name : Replace local environment variable in nuget config because cant provide it as a parameter
364+ run : sed -i "s|%TELBlazorPackageSource%|$TELBLAZOR_PACKAGE_LOCAL_OUTPUT_PATH|g" nuget.config
365+
366+ - name : Clean lock files because the newly generated package file will superseed the locks
367+ run : |
368+ find . -name "packages.lock.json" -type f -exec rm -f {} \;
369+
370+ - name : Create appsettings development from secrets
371+ run : |
372+ declare -A paths
373+ paths["./TELBlazor.Components.UnitTests/appsettings.Development.json"]='${{ secrets.UNITTESTS_APPSETTINGS_DEVELOPMENT }}'
374+ paths["./TELBlazor.Components.ShowCase.WasmStaticClient/wwwroot/appsettings.Development.json"]='${{ secrets.WASMSTATICCLIENT_APPSETTINGS_DEVELOPMENT }}'
375+ paths["./TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost.Client/wwwroot/appsettings.Development.json"]='${{ secrets.WASMSERVERHOSTCLIENT_APPSETTINGS_DEVELOPMENT }}'
376+ paths["./TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/appsettings.Development.json"]='${{ secrets.WASMSERVERHOST_APPSETTINGS_DEVELOPMENT }}'
377+
378+ # paths["./TELBlazor.Components.UnitTests/appsettings.Production.json"]='${{ secrets.UNITTESTS_APPSETTINGS_PRODUCTION }}'
379+ # paths["./TELBlazor.Components.ShowCase.WasmStaticClient/wwwroot/appsettings.Production.json"]='${{ secrets.WASMSTATICCLIENT_APPSETTINGS_PRODUCTION }}'
380+ # paths["./TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost.Client/wwwroot/appsettings.Production.json"]='${{ secrets.WASMSERVERHOSTCLIENT_APPSETTINGS_PRODUCTION }}'
381+ # paths["./TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/TELBlazor.Components.ShowCase.E2ETests.WasmServerHost/appsettings.Production.json"]='${{ secrets.WASMSERVERHOST_APPSETTINGS_PRODUCTION }}'
382+
383+
384+ for path in "${!paths[@]}"; do
385+ mkdir -p "$(dirname "$path")"
386+ printf '%s' "${paths[$path]}" > "$path"
387+ done
388+
389+
390+ - name : Set up Node.js so we have gulp for retrieving TEL Frontend Css
391+ uses : actions/setup-node@v4
392+ with :
393+ node-version : ' 20'
394+
395+ - name : Install npm packages so we have gulp for retrieving TEL Frontend Css
396+ working-directory : ./TELBlazor.Components
397+ run : npm ci
398+
399+ - name : Install ReportGenerator
400+ run : dotnet tool restore
401+
402+
403+
404+ - name : Build and create package locally
405+ env :
406+ # Overwrite package generation
407+ DISABLE_PACKAGE_GENERATION : false
408+ run : |
409+ dotnet build TELBlazor.Components -c Debug \
410+ /p:TELBlazorPackageVersion=$TELBLAZOR_PACKAGE_VERSION \
411+ /p:NupkgOutputPath=$TELBLAZOR_PACKAGE_LOCAL_OUTPUT_PATH \
412+ /p:UseTELBlazorComponentsProjectReference=$USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE \
413+ /p:TELBlazorPackageSource=$TELBLAZOR_PACKAGE_SOURCE \
414+ /p:DisablePackageGeneration=$DISABLE_PACKAGE_GENERATION \
415+ /p:E2ETracingEnabled=$E2E_TRACING_ENABLED \
416+ /p:HeadlessTesting=$HEADLESS_TESTING
417+
418+ - name : Build solution without generating new package
419+ env :
420+ # Overwrite package generation
421+ DISABLE_PACKAGE_GENERATION : true
422+ run : |
423+ dotnet build TELBlazor.sln -c Debug \
424+ /p:TELBlazorPackageVersion=$TELBLAZOR_PACKAGE_VERSION \
425+ /p:NupkgOutputPath=$TELBLAZOR_PACKAGE_LOCAL_OUTPUT_PATH \
426+ /p:UseTELBlazorComponentsProjectReference=$USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE \
427+ /p:TELBlazorPackageSource=$TELBLAZOR_PACKAGE_SOURCE \
428+ /p:DisablePackageGeneration=$DISABLE_PACKAGE_GENERATION \
429+ /p:E2ETracingEnabled=$E2E_TRACING_ENABLED \
430+ /p:HeadlessTesting=$HEADLESS_TESTING
431+
432+ - name : Ensure browsers are installed
433+ run : pwsh TELBlazor.Components.ShowCase.E2ETests/bin/Debug/net8.0/playwright.ps1 install --with-deps
434+
435+ - name : Run tests with coverage
436+ env :
437+ TELBlazorPackageVersion : ${{ env.TELBLAZOR_PACKAGE_VERSION }}
438+ NupkgOutputPath : ${{ env.TELBLAZOR_PACKAGE_LOCAL_OUTPUT_PATH }}
439+ UseTELBlazorComponentsProjectReference : ${{ env.USE_TEL_BLAZOR_COMPONENTS_PROJECT_REFERENCE }}
440+ TELBlazorPackageSource : ${{ env.TELBLAZOR_PACKAGE_SOURCE }}
441+ DisablePackageGeneration : ${{ env.DISABLE_PACKAGE_GENERATION }}
442+ E2ETracingEnabled : ${{ env.E2E_TRACING_ENABLED }}
443+ HeadlessTesting : ${{ env.HEADLESS_TESTING }}
444+ run : |
445+ dotnet test --collect:"XPlat Code Coverage"
446+
447+
448+ - name : Generate Coverage Report
449+ run : |
450+ dotnet reportgenerator \
451+ -reports:"**/TestResults/**/coverage.cobertura.xml" \
452+ -targetdir:coveragereport \
453+ -reporttypes:Html \
454+ -thresholdtype:line \
455+ -threshold:80
456+
457+ - name : Upload Coverage Report
458+ if : always()
459+ uses : actions/upload-artifact@v3
460+ with :
461+ name : coverage-report
462+ path : coveragereport
356463
357464
358465 reuseable-ci-checks-check-for-failed-jobs :
0 commit comments