mirror of
https://github.com/GyulyVGC/sniffnet.git
synced 2025-12-23 22:29:01 -05:00
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
83 lines
2.4 KiB
YAML
83 lines
2.4 KiB
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '*'
|
|
pull_request:
|
|
branches:
|
|
- '*'
|
|
workflow_call:
|
|
secrets:
|
|
NPCAP_OEM_URL:
|
|
required: true
|
|
CODECOV_TOKEN:
|
|
required: true
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
# Linters inspired from here: https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md
|
|
jobs:
|
|
|
|
rust:
|
|
name: ${{ matrix.os }}-latest
|
|
runs-on: ${{ matrix.os }}-latest
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
include:
|
|
- os: ubuntu
|
|
- os: macos
|
|
- os: windows
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt, clippy
|
|
|
|
- name: Install Linux dependencies
|
|
if: matrix.os == 'ubuntu'
|
|
run: sudo apt-get update -y && sudo apt-get install -y libpcap-dev libasound2-dev libgtk-3-dev
|
|
|
|
- name: Install Windows dependencies
|
|
if: matrix.os == 'windows' && github.event_name != 'pull_request'
|
|
run: |
|
|
Invoke-WebRequest -Uri "https://npcap.com/dist/npcap-sdk-1.13.zip" -OutFile "C:/npcap-sdk.zip"
|
|
Expand-Archive -LiteralPath C:/npcap-sdk.zip -DestinationPath C:/npcap-sdk
|
|
echo "LIB=C:/npcap-sdk/Lib/x64" >> $env:GITHUB_ENV
|
|
Invoke-WebRequest -Uri ${{secrets.NPCAP_OEM_URL}} -OutFile C:/npcap-oem.exe
|
|
C:/npcap-oem.exe /S
|
|
|
|
- name: fmt
|
|
run: cargo fmt --all -- --check
|
|
|
|
- name: build
|
|
if: matrix.os != 'windows' || github.event_name != 'pull_request'
|
|
run: cargo build --verbose
|
|
|
|
- name: clippy
|
|
if: matrix.os != 'windows' || github.event_name != 'pull_request'
|
|
run: cargo clippy -- -D warnings
|
|
|
|
- name: test
|
|
if: matrix.os != 'windows' || github.event_name != 'pull_request'
|
|
run: cargo test --verbose -- --nocapture
|
|
|
|
# - name: Install cargo-llvm-cov
|
|
# if: matrix.os == 'ubuntu'
|
|
# uses: taiki-e/install-action@cargo-llvm-cov
|
|
#
|
|
# - name: Generate code coverage
|
|
# if: matrix.os == 'ubuntu'
|
|
# run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info --include-build-script --no-cfg-coverage
|
|
#
|
|
# - name: Upload coverage to Codecov
|
|
# if: matrix.os == 'ubuntu'
|
|
# uses: codecov/codecov-action@v5
|
|
# with:
|
|
# files: lcov.info
|
|
# fail_ci_if_error: false
|
|
# token: ${{ secrets.CODECOV_TOKEN }}
|