#!/bin/bash set -euo # List of ignored modules ignored_folders=("dora-parler") # Skip test skip_test_folders=("dora-internvl" "dora-parler" "dora-keyboard" "dora-microphone" "terminal-input") # Get current working directory dir=$(pwd) # Get the base name of the directory (without the path) base_dir=$(basename "$dir") # Check if the directory name is in the ignored list if [[ " ${ignored_folders[@]} " =~ " ${base_dir} " ]]; then echo "Skipping $base_dir as we cannot test it on the CI..." else if [[ -f "Cargo.toml" && -f "pyproject.toml" ]]; then echo "Running build and tests for Rust project in $dir..." cargo check cargo clippy cargo build cargo test pip install "maturin[zig]" maturin build --zig --release # If GITHUB_EVENT_NAME is release or workflow_dispatch, publish the wheel if [ "$GITHUB_EVENT_NAME" == "release" ] || [ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]; then maturin publish --skip-existing --zig fi # aarch64-unknown-linux-gnu rustup target add aarch64-unknown-linux-gnu maturin build --target aarch64-unknown-linux-gnu --zig # If GITHUB_EVENT_NAME is release or workflow_dispatch, publish the wheel if [ "$GITHUB_EVENT_NAME" == "release" ] || [ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]; then maturin publish --target aarch64-unknown-linux-gnu --skip-existing --zig fi # armv7-unknown-linux-musleabihf rustup target add armv7-unknown-linux-musleabihf maturin build --target armv7-unknown-linux-musleabihf --zig # If GITHUB_EVENT_NAME is release or workflow_dispatch, publish the wheel if [ "$GITHUB_EVENT_NAME" == "release" ] || [ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]; then maturin publish --target armv7-unknown-linux-musleabihf --skip-existing --zig fi else if [ -f "$dir/Cargo.toml" ]; then echo "Running build and tests for Rust project in $dir..." cargo check cargo clippy cargo build cargo test if [ "$GITHUB_EVENT_NAME" == "release" ] || [ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]; then cargo publish fi else if [ -f "$dir/pyproject.toml" ]; then echo "CI: Installing in $dir..." uv venv --seed -p 3.11 uv pip install . echo "CI: Running Linting in $dir..." uv run ruff check . echo "CI: Running Pytest in $dir..." # Skip test for some folders if [[ " ${skip_test_folders[@]} " =~ " ${base_dir} " ]]; then echo "Skipping tests for $base_dir..." else uv run pytest fi if [ "$GITHUB_EVENT_NAME" == "release" ] || [ "$GITHUB_EVENT_NAME" == "workflow_dispatch" ]; then uv publish --check-url https://pypi.org/simple fi fi fi fi fi