simian 0.2.0

A command-line tool for exploring and implementing Machine Learning algorithms in Rust.
name: CI

on:
  push:
    branches:
      - main
  pull_request:
  schedule:
    # Run every Friday at 17:00 UTC to maintain the weekly release train
    - cron: "0 17 * * 5"

env:
  FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
  rust-checks:
    name: Rust Checks (Format, Clippy, Test)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy

      - name: Rust Cache
        uses: Swatinem/rust-cache@v2

      - name: Check Formatting
        run: cargo fmt --all -- --check

      - name: Run Clippy
        run: cargo clippy --all-targets --all-features -- -D warnings

      - name: Run Tests
        run: cargo test --all-targets --all-features

  ui-checks:
    name: UI Checks (Lint, Format, Typecheck, Test)
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./ui
    steps:
      - uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "24"
          cache: "npm"
          cache-dependency-path: "./ui/package-lock.json"

      - name: Install dependencies
        run: npm ci

      - name: Run Linter
        run: npm run lint

      - name: Check Formatting
        run: npx prettier --check "src/**/*.{ts,tsx,css,json}"

      - name: Run Typecheck
        run: npm run typecheck

      - name: Run Tests
        run: npm run test

  release-plz:
    name: Release-plz
    runs-on: ubuntu-latest
    needs: [rust-checks, ui-checks]
    # Only run release-plz if we are on the main branch (either via push or the scheduled cron)
    if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'schedule')
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable

      - name: Run release-plz
        uses: MarcoIeni/release-plz-action@v0.5
        env:
          GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PLZ_TOKEN }}
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}