Skip to content

Update Cargo.toml

Update Cargo.toml #962

Workflow file for this run

name: Lints-Tests
on:
push:
branches:
- main
- master
pull_request:
permissions:
contents: read
env:
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down
PYTHON_VERSION: "3.10"
jobs:
rust-lints-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
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
large-packages: true
docker-images: true
swap-storage: true
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: "3.x"
- name: Install Protocol Buffers Compiler
uses: arduino/setup-protoc@v3
with:
version: "33.2"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Rust
run: rustup override set stable && rustup update
- name: Install clippy
run: rustup component add clippy
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
cache-targets: "false"
- name: Run Lints
run: make lints
- name: Unit Tests
run: make test
env:
RUST_BACKTRACE: 1
rust-events-test:
runs-on: ubuntu-latest
needs: [rust-lints-test]
steps:
- uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
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
large-packages: true
docker-images: true
swap-storage: true
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: "3.x"
- name: Install Protocol Buffers Compiler
uses: arduino/setup-protoc@v3
with:
version: "33.2"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Rust
run: rustup override set stable && rustup update
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
cache-targets: "false"
- name: Setup Server
run: make start.server
env:
RUST_BACKTRACE: 1
- name: Test Kafka Events
run: make test.kafka_events
env:
RUST_BACKTRACE: 1
- name: Test RabbitMQ Events
run: make test.rabbitmq_events
env:
RUST_BACKTRACE: 1
- name: Test Redis Events
run: make test.redis_events
env:
RUST_BACKTRACE: 1
- name: Stop Server
if: always()
run: make stop.server
test-os:
name: test ${{ matrix.os }}-${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos]
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.os }}-latest
needs: [rust-lints-test]
steps:
- uses: actions/checkout@v4
- name: install rust stable
uses: dtolnay/rust-toolchain@stable
- name: Install Protocol Buffers Compiler
uses: arduino/setup-protoc@v3
with:
version: "33.2"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: cache rust
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-${{ matrix.python-version }}-v1
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Create virtual environment
working-directory: ./py-scouter
run: make setup.project
- name: Lints
working-directory: ./py-scouter
run: make lints.ci
- name: Run tests and report coverage
working-directory: ./py-scouter
run: make test.unit
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
test-windows:
name: test ${{ matrix.os }}-${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
os: [windows]
python-version: ["3.10", "3.11", "3.12.6"]
runs-on: ${{ matrix.os }}-latest
needs: [rust-lints-test]
steps:
- uses: actions/checkout@v4
- name: Install Protocol Buffers Compiler
uses: arduino/setup-protoc@v3
with:
version: "33.2"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: install rust stable
uses: dtolnay/rust-toolchain@stable
- name: cache rust
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-${{ matrix.python-version }}-v1
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Create virtual environment
working-directory: ./py-scouter
run: make setup.project
- name: Lints
working-directory: ./py-scouter
run: make lints.ci
- name: Run tests and report coverage
working-directory: ./py-scouter
run: make test.unit
test-os-integration:
needs: [test-os]
name: test integration
strategy:
fail-fast: false
matrix:
os: [ubuntu]
python-version: ["3.12"]
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- name: install rust stable
uses: dtolnay/rust-toolchain@stable
- name: Install Protocol Buffers Compiler
uses: arduino/setup-protoc@v3
with:
version: "33.2"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: cache rust
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.os }}-${{ matrix.python-version }}-v1
- name: Setup Backends
run: make build.all_backends
env:
RUST_BACKTRACE: 1
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: Create virtual environment
working-directory: ./py-scouter
run: make setup.project
- name: Run tests
working-directory: ./py-scouter
run: |
make test.integration
- name: Stop Containers
if: always()
run: make build.shutdown
test-py-build-linux:
name: build - ${{ matrix.runner-type }} - ${{ matrix.manylinux }} - ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
manylinux: auto
runner-type: ubuntu-latest
runner: ubuntu-latest
docker-options: "-e CI"
- target: aarch64-unknown-linux-gnu
manylinux: "2_28"
runner-type: ubuntu-24.04-arm
runner: ubuntu-24.04-arm
docker-options: "-e CI -e SIMSIMD_DISABLE_SVE=1 -e SIMSIMD_TARGET_SVE=0 -e SIMSIMD_TARGET_SVE2=0"
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: Install Protocol Buffers Compiler
uses: arduino/setup-protoc@v3
with:
version: "33.2"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: pip install -U "twine>=6.1.0" "packaging>=24.2"
- name: Set OPENSSL_DIR environment variable
run: echo "OPENSSL_DIR=/usr" >> $GITHUB_ENV
- name: Build wheel
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: ${{ matrix.manylinux }}
args: --release --out dist
rust-toolchain: stable
docker-options: ${{ matrix.docker-options }}
working-directory: ./py-scouter
before-script-linux: |
# Install required packages
if command -v yum &> /dev/null; then
yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic
# If we're running on i686 we need to symlink libatomic
# in order to build openssl with -latomic flag.
if [[ ! -d "/usr/lib64" ]]; then
ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so
fi
else
# If we're running on debian-based system.
apt update -y && apt-get install -y libssl-dev openssl pkg-config
fi
# Determine architecture
ARCH=$(uname -m)
echo "Detected architecture: $ARCH"
# Install Protocol Buffers Compiler (protoc)
PROTOC_VERSION="33.2"
if [[ "$ARCH" == "x86_64" ]]; then
PROTOC_ARCH="linux-x86_64"
elif [[ "$ARCH" == "aarch64" ]]; then
PROTOC_ARCH="linux-aarch_64"
else
echo "Unsupported architecture for protoc: $ARCH"
exit 1
fi
echo "Installing protoc ${PROTOC_VERSION} for ${PROTOC_ARCH}"
curl -LO "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-${PROTOC_ARCH}.zip"
unzip "protoc-${PROTOC_VERSION}-${PROTOC_ARCH}.zip" -d /usr/local
rm "protoc-${PROTOC_VERSION}-${PROTOC_ARCH}.zip"
chmod +x /usr/local/bin/protoc
protoc --version
# Install bindgen CLI
cargo install --force --locked bindgen-cli
if [[ "$ARCH" == "x86_64" ]]; then
echo "Downloading CMake for x86_64 architecture"
curl -L https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4-linux-x86_64.sh -o cmake.sh
chmod +x cmake.sh
./cmake.sh --skip-license --prefix=/usr/local
elif [[ "$ARCH" == "aarch64" ]]; then
echo "Downloading CMake for aarch64 architecture"
curl -L https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4-linux-aarch64.sh -o cmake.sh
chmod +x cmake.sh
./cmake.sh --skip-license --prefix=/usr/local
elif [[ "$ARCH" == "i686" ]]; then
echo "Downloading CMake for x86 architecture"
curl -L https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4.tar.gz -o cmake.tar.gz
tar -xzf cmake.tar.gz
cd cmake-3.26.4
./bootstrap --prefix=/usr/local
make -j$(nproc)
make install
cd ..
else
echo "Unsupported architecture: $ARCH"
exit 1
fi
cmake --version
# Set ARM64-specific environment variables for simsimd
if [[ "$ARCH" == "aarch64" ]]; then
echo "Setting up ARM64 build environment"
export SIMSIMD_DISABLE_SVE=1
export SIMSIMD_TARGET_SVE=0
export SIMSIMD_TARGET_SVE2=0
export SIMSIMD_TARGET_SVE_F16=0
export SIMSIMD_TARGET_SVE_BF16=0
export SIMSIMD_TARGET_SVE_I8=0
export CFLAGS="-march=armv8-a"
export CXXFLAGS="-march=armv8-a"
fi
- name: Check dist
working-directory: ./py-scouter
run: ls -lh dist/
- name: Check wheel
working-directory: ./py-scouter
run: twine check --strict dist/*