Skip to content

Commit 8a30c87

Browse files
🩹 [Refactor]: Remove Get-CodeCoverage workflow to streamline CI configuration
1 parent 49e39c0 commit 8a30c87

File tree

1 file changed

+0
-93
lines changed

1 file changed

+0
-93
lines changed

ā€Ž.github/workflows/workflow.yml

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -213,99 +213,6 @@ jobs:
213213
Verbose: ${{ inputs.Verbose }}
214214
Version: ${{ inputs.Version }}
215215

216-
# Get-CodeCoverage:
217-
# name: Get-CodeCoverage
218-
# runs-on: ubuntu-latest
219-
# needs:
220-
# - Test-SourceCode
221-
# - Test-Module
222-
# - Test-ModuleLocal
223-
# steps:
224-
# - name: Get-CodeCoverage
225-
# uses: PSModule/GitHub-Script@v1
226-
# with:
227-
# Debug: ${{ inputs.Debug }}
228-
# Prerelease: ${{ inputs.Prerelease }}
229-
# Verbose: ${{ inputs.Verbose }}
230-
# Version: ${{ inputs.Version }}
231-
# Script: |
232-
# $PSStyle.OutputRendering = 'Ansi'
233-
# $repo = $env:GITHUB_REPOSITORY
234-
# $runId = $env:GITHUB_RUN_ID
235-
# gh run download $runId --repo $repo --pattern *-CodeCoverage
236-
# $files = Get-ChildItem -Path . -Recurse -File | Select-Object -ExpandProperty FullName | Sort-Object
237-
# # Load the first XML as the base report
238-
# [xml]$mergedReport = Get-Content -Path $files[0]
239-
240-
# # Function to merge counters
241-
# function Merge-Counters($baseNode, $newNode) {
242-
# foreach ($newCounter in $newNode.counter) {
243-
# $baseCounter = $baseNode.counter | Where-Object { $_.type -eq $newCounter.type }
244-
# if ($baseCounter) {
245-
# $baseCounter.missed = [int]$baseCounter.missed + [int]$newCounter.missed
246-
# $baseCounter.covered = [int]$baseCounter.covered + [int]$newCounter.covered
247-
# } else {
248-
# # Import new counter if it doesn't exist
249-
# $importedCounter = $mergedReport.ImportNode($newCounter, $true)
250-
# $baseNode.AppendChild($importedCounter) | Out-Null
251-
# }
252-
# }
253-
# }
254-
255-
# # Loop through remaining reports to merge coverage data
256-
# foreach ($reportPath in $files[1..($files.Count - 1)]) {
257-
# [xml]$currentReport = Get-Content -Path $reportPath
258-
259-
# # Merge the top-level counters
260-
# Merge-Counters -baseNode $mergedReport.report -newNode $currentReport.report
261-
262-
# # Merge packages and classes
263-
# foreach ($package in $currentReport.report.package) {
264-
# $basePackage = $mergedReport.report.package | Where-Object { $_.name -eq $package.name }
265-
266-
# if ($basePackage) {
267-
# # Merge counters at package level
268-
# Merge-Counters -baseNode $basePackage -newNode $package
269-
270-
# foreach ($class in $package.class) {
271-
# $baseClass = $basePackage.class | Where-Object { $_.name -eq $class.name }
272-
# if ($baseClass) {
273-
# # Merge counters at class level
274-
# Merge-Counters -baseNode $baseClass -newNode $class
275-
# } else {
276-
# # Import new class
277-
# $importedClass = $mergedReport.ImportNode($class, $true)
278-
# $basePackage.AppendChild($importedClass) | Out-Null
279-
# }
280-
# }
281-
# } else {
282-
# # Import entire new package
283-
# $importedPackage = $mergedReport.ImportNode($package, $true)
284-
# $mergedReport.report.AppendChild($importedPackage) | Out-Null
285-
# }
286-
# }
287-
# }
288-
289-
# # Output the combined report
290-
# $mergedReport.Save("merged-jacoco-report.xml")
291-
292-
# # Assuming $mergedReport is your final [xml] object:
293-
# $xmlString = $mergedReport.OuterXml
294-
295-
# # To format (pretty-print) the XML nicely:
296-
# $stringWriter = New-Object System.IO.StringWriter
297-
# $xmlWriter = [System.Xml.XmlTextWriter]::new($stringWriter)
298-
# $xmlWriter.Formatting = "Indented"
299-
# $mergedReport.WriteTo($xmlWriter)
300-
# $xmlWriter.Flush()
301-
# $prettyXml = $stringWriter.ToString()
302-
303-
# $prettyXml | Out-String
304-
305-
# # Output or export the XML string
306-
# # $prettyXml | Out-File -FilePath "merged-jacoco-report.xml" -Encoding UTF8
307-
308-
309216
# TestModuleStatus:
310217
# name: Test module status
311218
# if: ${{ contains(fromJson('["success", "skipped"]'), needs.TestModule-pwsh-ubuntu-latest.result) && contains(fromJson('["success", "skipped"]'), needs.TestModule-pwsh-macos-latest.result) && contains(fromJson('["success", "skipped"]'), needs.TestModule-pwsh-windows-latest.result) && !cancelled() }}

0 commit comments

Comments
Ā (0)