🐎 ci: rust build #15
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: [push, pull_request] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
env: | |
NPCAP_SDK_URL: "https://npcap.com/dist/npcap-sdk-1.15.zip" | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Cache Windows dependencies | |
if: matrix.os == 'windows-latest' | |
id: cache-windows | |
uses: actions/cache@v4 | |
with: | |
key: ${{ env.NPCAP_SDK_URL }} | |
path: .\Packet.lib | |
- name: Install Windows dependencies | |
if: matrix.os == 'windows-latest' && steps.cache-windows.outputs.cache-hit != 'true' | |
shell: pwsh | |
run: | | |
$sdkPath = ".\tmp" | |
mkdir $sdkPath | |
Invoke-WebRequest -Uri $env:NPCAP_SDK_URL -OutFile "$sdkPath\npcap-sdk.zip" | |
Expand-Archive -Path "$sdkPath\npcap-sdk.zip" -DestinationPath $sdkPath | |
Copy-Item -Path "$sdkPath\Lib\x64\Packet.lib" -Destination . | |
- name: Build | |
run: cargo build --verbose | |
- name: Build for release | |
run: cargo build --release --verbose | |
# - name: Run tests | |
# run: cargo test --verbose |