Skip to content

Release 0.10.0

Release 0.10.0 #1878

Workflow file for this run

name: "CI/CD"
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
Unit-Tests:
name: Unit Tests
runs-on: ${{ matrix.os }}
env:
DYLD_LIBRARY_PATH: /Library/Frameworks/GStreamer.framework/Versions/Current/lib:$DYLD_LIBRARY_PATH
BASE_FEATURES: macro_debug,mock,perf-ui,image,kornia,gst,faer,nalgebra,glam,debug_pane,bincode,log-level-debug
strategy:
matrix:
# os: [ ubuntu-22.04, macos-latest, windows-latest ]
os: [ ubuntu-22.04, macos-latest ]
mode: [ debug, release, cuda-release ]
exclude:
- os: macos-latest
mode: cuda-release
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: rustc,cargo,rust-std,rustfmt,clippy
- name: Setup rust-cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ matrix.mode }}
shared-key: rust-${{ matrix.os }}
save-if: ${{ github.ref == 'refs/heads/master' }}
cache-targets: "false"
cache-bin: "false"
- name: Install latest nextest
uses: taiki-e/install-action@nextest
- name: Install winget
if: runner.os == 'Windows'
uses: Cyberboss/install-winget@v1
- name: Free Disk Space (Ubuntu)
if: runner.os == 'Linux'
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
android: true
dotnet: true
haskell: true
# do not remove large-packages, as it is necessary
large-packages: false
docker-images: true
swap-storage: true
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y pkg-config libudev-dev libpcap-dev libglib2.0-dev
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: |
# Verify winget availability
if (!(Get-Command winget -ErrorAction SilentlyContinue)) {
Write-Host "winget is not installed or available."
exit 1
}
# Install PCAP SDK
Invoke-WebRequest -Uri https://npcap.com/dist/npcap-sdk-1.13.zip -OutFile npcap-sdk.zip
Expand-Archive -Path npcap-sdk.zip -DestinationPath $env:USERPROFILE\npcap-sdk
Remove-Item npcap-sdk.zip
# Install Win10Pcap (if winget is available)
winget install DaiyuuNobori.Win10Pcap --accept-source-agreements --accept-package-agreements
# Set PCAP library path
echo "LIB=$env:USERPROFILE\npcap-sdk\Lib\x64" | Out-File -Append -Encoding utf8 $env:GITHUB_ENV
- name: Setup GStreamer (x86_64)
if: runner.os != 'MacOs'
id: setup_gstreamer_mac
uses: blinemedical/[email protected]
with:
arch: 'x86_64'
version: 1.24.12
- name: Setup GStreamer
if: runner.os == 'MacOS'
id: setup_gstreamer_other
uses: blinemedical/[email protected]
with:
arch: 'arm64'
version: 1.24.12
- name: Debug GStreamer Installation
if: runner.os == 'macOS'
run: |
echo "Checking GStreamer version..."
pkg-config --modversion gstreamer-1.0 || { echo "GStreamer not found!"; }
echo "Checking GStreamer library path..."
if [[ -d "/Library/Frameworks/GStreamer.framework" ]]; then
echo "GStreamer is installed at /Library/Frameworks/GStreamer.framework"
else
echo "GStreamer framework is missing!"
fi
echo "Checking GStreamer shared libraries..."
ls -l /Library/Frameworks/GStreamer.framework/Versions/Current/lib/ | grep libgstapp || { echo "libgstapp missing!"; }
echo "Checking PKG_CONFIG_PATH..."
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
echo "Checking DYLD_LIBRARY_PATH..."
echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH"
echo "Checking linked libraries for cu_gstreamer..."
if ls target/debug/deps/cu_gstreamer-* 1> /dev/null 2>&1; then
otool -L target/debug/deps/cu_gstreamer-* | grep libgstapp || { echo "libgstapp is not linked!"; }
else
echo "cu_gstreamer binary not found, skipping otool check."
fi
- name: Install CUDA
uses: Jimver/[email protected]
if: runner.os != 'macOS' && matrix.mode == 'cuda-release'
with:
cuda: 12.6.1
log-file-suffix: '${{ matrix.os }}-${{ matrix.mode }}-cuda.txt'
use-github-cache: false
use-local-cache: false
- name: Set build mode (Linux / MacOS)
if: runner.os != 'Windows' && ( matrix.mode == 'release' || matrix.mode == 'cuda-release' )
run: echo "RELEASE_FLAG=--release" >> $GITHUB_ENV
- name: Set build mode (Windows)
if: runner.os == 'Windows' && ( matrix.mode == 'release' || matrix.mode == 'cuda-release' )
run: |
Add-Content -Path $env:GITHUB_ENV -Value "RELEASE_FLAG=--release"
- name: Set features (Linux)
if: runner.os == 'Linux'
run: |
if [[ '${{ matrix.mode }}' == 'cuda-release' ]]; then
echo "FEATURES_FLAG=--features $BASE_FEATURES,python,cuda" >> $GITHUB_ENV
else
echo "FEATURES_FLAG=--features $BASE_FEATURES,python" >> $GITHUB_ENV
fi
- name: Set features (MacOS)
if: runner.os == 'macOS'
run: |
if [[ '${{ matrix.mode }}' == 'cuda-release' ]]; then
echo "FEATURES_FLAG=--features $BASE_FEATURES,cuda" >> $GITHUB_ENV
else
echo "FEATURES_FLAG=--features $BASE_FEATURES" >> $GITHUB_ENV
fi
- name: Set features (Windows)
if: runner.os == 'Windows'
run: |
$features = if ($env:matrix_mode -eq 'cuda-release') {
'--features macro_debug,mock,perf-ui,image,kornia,python,gst,faer,nalgebra,glam,debug_pane,bincode,cuda'
} else {
'--features macro_debug,mock,perf-ui,image,kornia,python,gst,faer,nalgebra,glam,debug_pane,bincode'
}
Add-Content -Path $env:GITHUB_ENV -Value "FEATURES_FLAG=$features"
# Run Clippy and build
- name: Run clippy on (${{ matrix.os }} | ${{matrix.mode}})
run: cargo +stable clippy $RELEASE_FLAG --workspace --all-targets -- --deny warnings
- name: Run clippy with all features on (${{ matrix.os }} | ${{matrix.mode}})
run: cargo +stable clippy $RELEASE_FLAG --workspace --all-targets $FEATURES_FLAG -- --deny warnings
- name: Run build with all features on (${{ matrix.os }} | ${{matrix.mode}})
run: cargo +stable build $RELEASE_FLAG --workspace --all-targets $FEATURES_FLAG
- name: Run doctests on (${{ matrix.os }} | debug)
if: matrix.mode == 'debug'
run: cargo +stable test --doc --workspace
# Run Unit Tests
- name: Run Unit Tests on (${{ matrix.os }} | ${{matrix.mode}})
run: cargo +stable nextest run $RELEASE_FLAG --all-targets --workspace
- name: Run Unit Tests with all features on (${{ matrix.os }} | ${{matrix.mode}})
run: cargo +stable nextest run $RELEASE_FLAG --all-targets --workspace $FEATURES_FLAG
# Run Project Generation Tests
- name: Install cargo-generate on (${{ matrix.os }} | debug)
if: matrix.mode == 'debug'
run: cargo +stable install cargo-generate
- name: Generate new project on (${{ matrix.os }} | debug)
if: matrix.mode == 'debug'
run: |
cd templates
cargo +stable generate -p cu_full --name test_project --destination . -d copper_source=local -d copper_root_path=../.. --silent
- name: Build generated project on (${{ matrix.os }} | debug)
if: matrix.mode == 'debug'
run: |
cd templates/test_project
cargo +stable build
typos:
name: Typos & Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: crate-ci/typos@master
with:
config: ./.config/_typos.toml
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo +stable fmt --all -- --check
embedded:
name: CI for embedded targets
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-unknown-none,thumbv8m.main-none-eabihf,riscv32imac-unknown-none-elf
components: rustc,rustfmt
- name: Install latest nextest
uses: taiki-e/install-action@nextest
- name: Check compilation of core with no-std
run: cargo +stable build --no-default-features
- name: Unit tests of core with no-std
run: cargo +stable nextest run --no-default-features
- name: Clippy a no-std example
run: cargo +stable clippy -p cu-min-baremetal --no-default-features --config examples/cu_min_baremetal/.cargo/config-nostd.toml
- name: Compile a no-std example from Copper
run: cargo +stable build -p cu-min-baremetal --no-default-features --config examples/cu_min_baremetal/.cargo/config-nostd.toml
- name: Clippy an rp2350 example
working-directory: examples/cu_rp2350_skeleton
run: cargo +stable clippy
- name: Cross compile an rp2350 example with Arm
working-directory: examples/cu_rp2350_skeleton
run: cargo +stable build-arm
- name: Compile the logreader for the rp2350 example (host)
working-directory: examples/cu_rp2350_skeleton
run: cargo +stable build-logreader