name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-pc-windows-msvc
override: true
- name: Download WinDivert
run: |
Invoke-WebRequest -Uri "https://reqrypt.org/download/WinDivert-2.2.2-A.zip" -OutFile "WinDivert.zip"
Expand-Archive -Path "WinDivert.zip" -DestinationPath "WinDivert"
- name: List extracted files (Debug)
run: |
Get-ChildItem -Recurse "WinDivert"
- name: Copy WinDivert Files
run: |
$dllPath = (Get-ChildItem -Path "WinDivert" -Recurse -Filter "WinDivert.dll").FullName
$libPath = (Get-ChildItem -Path "WinDivert" -Recurse -Filter "WinDivert.lib").FullName
Copy-Item $dllPath "$env:USERPROFILE\.cargo\bin\WinDivert.dll"
Copy-Item $libPath "$env:USERPROFILE\.cargo\bin\WinDivert.lib"
- name: Build (Windows)
run: cargo build --verbose --all-targets
- name: Run tests (Windows)
run: cargo test --verbose --all-targets