Skip to content

CI (Windows)

CI (Windows) #107

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, <zenoh@zettascale.tech>
#
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 Windows
runs-on: windows-2022
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))) {
choco install -y --force --no-progress $pkg
}
}
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 { choco install --force --no-progress python3 --version=3.11 }
- name: Code format check
run: cargo fmt -- --check
- name: Clippy
run: cargo clippy --all-targets -- --deny warnings
- name: Build
run: cargo build --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}