|
| 1 | +name: Code Coverage |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + - release/* |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - main |
| 12 | + - release/* |
| 13 | + |
| 14 | +concurrency: |
| 15 | + # Cancel any workflow currently in progress for the same PR. |
| 16 | + # Allow running concurrently with any other commits. |
| 17 | + group: codecoverage-${{ github.event.pull_request.number || github.sha }} |
| 18 | + cancel-in-progress: true |
| 19 | + |
| 20 | +permissions: read-all |
| 21 | + |
| 22 | +jobs: |
| 23 | + build-windows: |
| 24 | + name: Build WinUser |
| 25 | + strategy: |
| 26 | + fail-fast: false |
| 27 | + matrix: |
| 28 | + vec: [ |
| 29 | + { config: "Debug", plat: "windows", os: "windows-2022", arch: "x64", tls: "schannel", test: "-Test" }, |
| 30 | + ] |
| 31 | + uses: ./.github/workflows/build-reuse-win.yml |
| 32 | + with: |
| 33 | + config: ${{ matrix.vec.config }} |
| 34 | + plat: ${{ matrix.vec.plat }} |
| 35 | + os: ${{ matrix.vec.os }} |
| 36 | + arch: ${{ matrix.vec.arch }} |
| 37 | + tls: ${{ matrix.vec.tls }} |
| 38 | + xdp: ${{ matrix.vec.xdp }} |
| 39 | + sanitize: ${{ matrix.vec.sanitize }} |
| 40 | + test: ${{ matrix.vec.test }} |
| 41 | + |
| 42 | + bvt-winlatest: |
| 43 | + name: BVT WinPrerelease |
| 44 | + needs: [build-windows] |
| 45 | + strategy: |
| 46 | + fail-fast: false |
| 47 | + matrix: |
| 48 | + vec: [ |
| 49 | + { config: "Debug", plat: "windows", os: "windows-2022", arch: "x64", tls: "schannel", test: "-Test" }, |
| 50 | + ] |
| 51 | + runs-on: |
| 52 | + - self-hosted |
| 53 | + - "1ES.Pool=msquic-1es-pool" |
| 54 | + - "1ES.ImageOverride=WSPrerelease" |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 |
| 57 | + with: |
| 58 | + fetch-depth: 0 |
| 59 | + - name: Download Build Artifacts |
| 60 | + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a |
| 61 | + with: |
| 62 | + name: ${{ matrix.vec.config }}-${{ matrix.vec.plat }}-${{ matrix.vec.os }}-${{ matrix.vec.arch }}-${{ matrix.vec.tls }}${{ matrix.vec.xdp }}${{ matrix.vec.sanitize }}${{ matrix.vec.test }} |
| 63 | + path: artifacts |
| 64 | + - name: Prepare Machine |
| 65 | + run: scripts/prepare-machine.ps1 -Tls ${{ matrix.vec.tls }} -ForTest ${{ matrix.vec.xdp }} -InstallCodeCoverage |
| 66 | + shell: pwsh |
| 67 | + - name: Install ETW Manifest |
| 68 | + shell: pwsh |
| 69 | + run: | |
| 70 | + $MsQuicDll = ".\artifacts\bin\windows\${{ matrix.vec.arch }}_${{ matrix.vec.config }}_${{ matrix.vec.tls }}\msquic.dll" |
| 71 | + $ManifestPath = ".\src\manifest\MsQuicEtw.man" |
| 72 | + wevtutil.exe um $ManifestPath |
| 73 | + wevtutil.exe im $ManifestPath /rf:$($MsQuicDll) /mf:$($MsQuicDll) |
| 74 | + - name: Test |
| 75 | + shell: pwsh |
| 76 | + timeout-minutes: 120 |
| 77 | + continue-on-error: true |
| 78 | + run: scripts/test.ps1 -NoProgress -IsolationMode Batch -CodeCoverage -Config ${{ matrix.vec.config }} -Arch ${{ matrix.vec.arch }} -Tls ${{ matrix.vec.tls }} ${{ matrix.vec.xdp }} ${{ matrix.vec.qtip }} |
| 79 | + - name: Upload Results |
| 80 | + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce |
| 81 | + with: |
| 82 | + name: BVT-${{ matrix.vec.config }}-${{ matrix.vec.plat }}-${{ matrix.vec.os }}-${{ matrix.vec.arch }}-${{ matrix.vec.tls }}${{ matrix.vec.xdp }}${{ matrix.vec.qtip }}${{ matrix.vec.systemcrypto }}${{ matrix.vec.sanitize }} |
| 83 | + path: artifacts/coverage/*.cov |
| 84 | + |
| 85 | + stress-winlatest: |
| 86 | + name: Stress WinPrerelease |
| 87 | + needs: [build-windows] |
| 88 | + strategy: |
| 89 | + fail-fast: false |
| 90 | + matrix: |
| 91 | + vec: [ |
| 92 | + { config: "Debug", plat: "windows", os: "windows-2022", arch: "x64", tls: "schannel", test: "-Test" }, |
| 93 | + ] |
| 94 | + runs-on: |
| 95 | + - self-hosted |
| 96 | + - "1ES.Pool=msquic-1es-pool" |
| 97 | + - "1ES.ImageOverride=WSPrerelease" |
| 98 | + env: |
| 99 | + main-timeout: 3600000 |
| 100 | + main-repeat: 100 |
| 101 | + main-allocfail: 100 |
| 102 | + pr-timeout: 600000 |
| 103 | + pr-repeat: 20 |
| 104 | + pr-allocfail: 100 |
| 105 | + steps: |
| 106 | + - name: Checkout repository |
| 107 | + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 |
| 108 | + with: |
| 109 | + fetch-depth: 0 |
| 110 | + - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a |
| 111 | + with: |
| 112 | + name: ${{ matrix.vec.config }}-${{ matrix.vec.plat }}-${{ matrix.vec.os }}-${{ matrix.vec.arch }}-${{ matrix.vec.tls }}${{ matrix.vec.xdp }}${{ matrix.vec.sanitize }}${{ matrix.vec.test }} |
| 113 | + path: artifacts |
| 114 | + - name: Prepare Machine |
| 115 | + run: scripts/prepare-machine.ps1 -Tls ${{ matrix.vec.tls }} -ForTest ${{ matrix.vec.xdp }} -InstallCodeCoverage |
| 116 | + shell: pwsh |
| 117 | + - name: spinquic (PR) |
| 118 | + if: github.event_name == 'pull_request' |
| 119 | + timeout-minutes: 15 |
| 120 | + continue-on-error: true |
| 121 | + shell: pwsh |
| 122 | + run: scripts/spin.ps1 -Config ${{ matrix.vec.config }} -Arch ${{ matrix.vec.arch }} -Tls ${{ matrix.vec.tls }} -Timeout ${{ env.pr-timeout }} -RepeatCount ${{ env.pr-repeat }} -AllocFail ${{ env.pr-allocfail }} ${{ matrix.vec.xdp }} -CodeCoverage -LogProfile Basic.Light |
| 123 | + - name: spinquic (Official) |
| 124 | + if: github.event_name != 'pull_request' |
| 125 | + timeout-minutes: 65 |
| 126 | + continue-on-error: true |
| 127 | + shell: pwsh |
| 128 | + run: scripts/spin.ps1 -Config ${{ matrix.vec.config }} -Arch ${{ matrix.vec.arch }} -Tls ${{ matrix.vec.tls }} -Timeout ${{ env.main-timeout }} -RepeatCount ${{ env.main-repeat }} -AllocFail ${{ env.main-allocfail }} ${{ matrix.vec.xdp }} -CodeCoverage -LogProfile Basic.Light |
| 129 | + - name: Upload Results |
| 130 | + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce |
| 131 | + with: |
| 132 | + name: Spin-${{ matrix.vec.config }}-${{ matrix.vec.plat }}-${{ matrix.vec.os }}-${{ matrix.vec.arch }}-${{ matrix.vec.tls }}${{ matrix.vec.xdp }}${{ matrix.vec.sanitize }} |
| 133 | + path: artifacts/coverage/*.cov |
| 134 | + |
| 135 | + merge-coverage: |
| 136 | + name: Merge Coverage |
| 137 | + needs: [bvt-winlatest, stress-winlatest] |
| 138 | + runs-on: windows-2022 |
| 139 | + steps: |
| 140 | + - name: Checkout repository |
| 141 | + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 |
| 142 | + with: |
| 143 | + fetch-depth: 0 |
| 144 | + - name: Prepare Machine |
| 145 | + run: scripts/prepare-machine.ps1 -ForTest -InstallCodeCoverage |
| 146 | + shell: pwsh |
| 147 | + - name: Create Folder for Artifacts |
| 148 | + shell: pwsh |
| 149 | + run: | |
| 150 | + New-Item -ItemType Directory -Force -Path artifacts\coverage\windows\x64_Debug_schannel |
| 151 | + - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a |
| 152 | + name: Download BVT Coverage Results |
| 153 | + with: |
| 154 | + name: BVT-Debug-windows-windows-2022-x64-schannel |
| 155 | + path: artifacts\coverage\windows\x64_Debug_schannel |
| 156 | + - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a |
| 157 | + name: Download SpinQuic Coverage Results |
| 158 | + with: |
| 159 | + name: Spin-Debug-windows-windows-2022-x64-schannel |
| 160 | + path: artifacts\coverage\windows\x64_Debug_schannel |
| 161 | + - name: Dir Folder for Artifacts |
| 162 | + shell: pwsh |
| 163 | + run: | |
| 164 | + dir artifacts\coverage\windows\x64_Debug_schannel |
| 165 | + - name: Merge |
| 166 | + shell: pwsh |
| 167 | + run: scripts/merge-coverage.ps1 -Config Debug -Arch x64 -Tls schannel |
| 168 | + - name: Upload Results |
| 169 | + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce |
| 170 | + with: |
| 171 | + name: merged |
| 172 | + path: artifacts\coverage\windows\x64_Debug_schannel\msquiccoverage.xml |
| 173 | + |
| 174 | + publish-coverage: |
| 175 | + name: Generate Summary |
| 176 | + needs: [merge-coverage] |
| 177 | + runs-on: ubuntu-22.04 |
| 178 | + steps: |
| 179 | + - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a |
| 180 | + name: Download Merged Coverage Report |
| 181 | + with: |
| 182 | + name: merged |
| 183 | + - name: Code Coverage Summary Report |
| 184 | + uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 |
| 185 | + with: |
| 186 | + filename: msquiccoverage.xml |
| 187 | + badge: true |
| 188 | + format: 'markdown' |
| 189 | + output: 'both' |
| 190 | + - name: Write to Job Summary |
| 191 | + run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY |
0 commit comments