name: CI
on:
push:
branches: [main, develop]
pull_request:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_MEMEX_REF: 047e63bd9c89bb174fed6e69f9a3a9c203e04981
jobs:
check:
name: ${{ matrix.name }}
runs-on: ${{ fromJSON(matrix.runner) }}
strategy:
fail-fast: false
matrix:
include:
- name: linux-self-hosted
runner: '["self-hosted", "ops-linux"]'
- name: macos-self-hosted
runner: '["self-hosted", "dragon-macos"]'
steps:
- uses: actions/checkout@v6
with:
path: aicx
- name: Checkout rust-memex sibling
uses: actions/checkout@v6
with:
repository: Loctree/rust-memex
ref: ${{ env.RUST_MEMEX_REF }}
path: rust-memex
- name: Install protoc
shell: bash
run: |
if command -v protoc >/dev/null 2>&1; then
echo "protoc already installed: $(protoc --version)"
exit 0
fi
if [[ "$RUNNER_OS" == "Linux" ]]; then
sudo apt-get update -qq
sudo apt-get install -y -qq protobuf-compiler
elif [[ "$RUNNER_OS" == "macOS" ]]; then
brew install protobuf
else
echo "::error::Unsupported OS for protoc install: $RUNNER_OS"
exit 1
fi
protoc --version
- uses: actions/setup-python@v6
if: runner.os == 'Linux'
with:
python-version: '3.x'
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: semgrep
if: runner.os == 'Linux'
working-directory: aicx
run: |
python -m pip install --upgrade pip semgrep
semgrep --config auto --error --quiet
- name: cargo check
working-directory: aicx
run: cargo check --locked
- name: cargo clippy default
working-directory: aicx
run: cargo clippy --locked -p aicx --all-targets -- -D warnings
- name: cargo clippy native GGUF
working-directory: aicx
run: |
cargo clippy --locked -p aicx-embeddings --features gguf -- -D warnings
cargo clippy --locked -p aicx --features native-embedder --all-targets -- -D warnings
- name: cargo test
working-directory: aicx
run: cargo test --locked --all-targets -- --test-threads=2
- name: cargo test native GGUF
working-directory: aicx
run: |
cargo test --locked -p aicx-embeddings --features gguf
cargo test --locked -p aicx --features native-embedder --test native_embedder
- name: cargo fmt
working-directory: aicx
run: cargo fmt -- --check