|
8 | 8 | env:
|
9 | 9 | TMPDIR: /tmp
|
10 | 10 | CI_MAX_KERNEL_VERSION: '6.11'
|
| 11 | + CI_MAX_EFW_VERSION: '0.20.0' |
11 | 12 | CI_MIN_CLANG_VERSION: '11'
|
12 | 13 | go_version: '~1.23'
|
13 | 14 | prev_go_version: '~1.22'
|
@@ -185,8 +186,8 @@ jobs:
|
185 | 186 | run: |
|
186 | 187 | sudo dmesg
|
187 | 188 |
|
188 |
| - vm-test: |
189 |
| - name: Run tests |
| 189 | + linux-test: |
| 190 | + name: Run tests (Linux) |
190 | 191 | runs-on: ubuntu-latest
|
191 | 192 | needs: build-and-lint
|
192 | 193 | timeout-minutes: 15
|
@@ -223,5 +224,70 @@ jobs:
|
223 | 224 | if: always()
|
224 | 225 | uses: actions/upload-artifact@v4
|
225 | 226 | with:
|
226 |
| - name: Test Results (${{ matrix.tag }}) |
| 227 | + name: Test Results (linux ${{ matrix.tag }}) |
227 | 228 | path: junit.xml
|
| 229 | + |
| 230 | + windows-test: |
| 231 | + name: Run tests (Windows) |
| 232 | + runs-on: windows-2022 |
| 233 | + needs: build-and-lint |
| 234 | + timeout-minutes: 15 |
| 235 | + strategy: |
| 236 | + matrix: |
| 237 | + version: |
| 238 | + - "0.20.0" |
| 239 | + env: |
| 240 | + # Fix slow Go compile and cache restore |
| 241 | + # See https://github.com/actions/setup-go/pull/515 |
| 242 | + GOCACHE: D:\gocache |
| 243 | + GOMODCACHE: D:\gomodcache |
| 244 | + GOTMPDIR: D:\gotmp |
| 245 | + |
| 246 | + steps: |
| 247 | + # Go requires gotmp to be present |
| 248 | + - run: mkdir D:\gotmp |
| 249 | + shell: pwsh |
| 250 | + |
| 251 | + - name: Download and Install eBPF for Windows |
| 252 | + shell: pwsh |
| 253 | + run: | |
| 254 | + Invoke-WebRequest -Uri "https://github.com/microsoft/ebpf-for-windows/releases/download/Release-v${{ matrix.version }}/Build-x64.Debug.zip" -OutFile "$env:TEMP\efw.zip" |
| 255 | + Expand-Archive -Path "$env:TEMP\efw.zip" -DestinationPath "$env:TEMP\ebpf" |
| 256 | + Set-Location "$env:TEMP\ebpf" |
| 257 | + # setup-ebpf.ps1 can't handle spaces in the path to the MSI. |
| 258 | + mv "Build-x64 Debug" "debug" |
| 259 | + $setupScript = Get-ChildItem -Path . -Filter "setup-ebpf.ps1" -Recurse | Select-Object -First 1 |
| 260 | + if ($setupScript) { |
| 261 | + Write-Host "Found setup script: $($setupScript.FullName)" |
| 262 | + Set-Location -Path $setupScript.DirectoryName |
| 263 | + Write-Host "Changed directory to: $(Get-Location)" |
| 264 | + & $setupScript.FullName |
| 265 | +
|
| 266 | + # Change service account to SYSTEM, until https://github.com/microsoft/ebpf-for-windows/pull/4095 is in a release. |
| 267 | + Write-Host "Changing ebpfsvc to run as SYSTEM" |
| 268 | + sc.exe config ebpfsvc obj= "LocalSystem" |
| 269 | + sc.exe start ebpfsvc |
| 270 | + } else { |
| 271 | + Write-Error "Setup script not found in the extracted package" |
| 272 | + exit 1 |
| 273 | + } |
| 274 | +
|
| 275 | + - uses: actions/checkout@v4 |
| 276 | + |
| 277 | + - name: Set up Go |
| 278 | + uses: actions/setup-go@v5 |
| 279 | + with: |
| 280 | + go-version: '${{ env.go_version }}' |
| 281 | + |
| 282 | + - run: go install gotest.tools/[email protected] |
| 283 | + |
| 284 | + - name: Test |
| 285 | + run: gotestsum --raw-command --ignore-non-json-output-lines --junitfile junit.xml -- go test -short -count 1 -json ./asm ./internal ./internal/kallsyms ./internal/kconfig ./internal/sysenc ./internal/testutils ./internal/tracefs |
| 286 | + |
| 287 | + - name: Upload Test Results |
| 288 | + if: always() |
| 289 | + uses: actions/upload-artifact@v4 |
| 290 | + with: |
| 291 | + name: Test Results (windows ${{ matrix.tag }}) |
| 292 | + path: junit.xml |
| 293 | + |
0 commit comments