Skip to content

CI (Windows)

CI (Windows) #2

Workflow file for this run

#
# Copyright (c) 2023 ZettaScale Technology
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# ZettaScale Zenoh Team, <[email protected]>
#
name: CI (Windows)
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
schedule:
- cron: "0 6 * * 1-5"
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
WIRESHARK_VERSION: 4.4
# NOTE: Use a pre-built wireshark library to speed up. This requires a manual installation.
# WIRESHARK_LIB_DIR: C:\Development\wireshark-4.4.0
jobs:
check:
name: Run checks on self-hosted Windows
runs-on: [self-hosted, "${{ matrix.os }}"]
strategy:
fail-fast: false
matrix:
os:
- windows-10
- windows-11
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
$installed = (choco list -l -r --id-only) -join " "
$install_list = @("xsltproc", "docbook-bundle", "nsis", "winflexbison3", "cmake", "7zip")
ForEach ($pkg in $install_list.split(" ")) {
if (-Not ($installed.contains($pkg))) {
gsudo choco install -y --force --no-progress $pkg
}
}
gsudo choco install -y --no-progress wireshark --version 4.2.0
# # WARN: Wireshark building seems to fail on Python 3.13
# # WARN: Use python"3" according to https://stackoverflow.com/a/74408229
# - name: Install Python if needed
# run: try { python -V } catch { gsudo choco install --force --no-progress python3 --version=3.11 }
- name: Install Rust toolchain
run: |
rustup show
rustup component add rustfmt clippy
- name: Code format check
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D warnings
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Place the plugin
run: |
$epan_dir = "$Env:APPDATA\Wireshark\plugins\${{ env.WIRESHARK_VERSION }}\epan"
if (-Not (Test-Path $epan_dir)) {
mkdir -p $epan_dir
}
cp .\target\release\zenoh_dissector.dll $epan_dir
- name: Test the sample data
run: |
& 'C:\Program Files\Wireshark\tshark.exe' -r .\assets\sample-data.pcap
if((& 'C:\Program Files\Wireshark\tshark.exe' -r .\assets\sample-data.pcap | Select-String -pattern "zenoh").length -ne 7) {return 1}
- name: Clean up
if: always()
uses: actions-rs/cargo@v1
with:
command: clean