Skip to content
Open

CI #1

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: CI

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]

env:
CARGO_TERM_COLOR: always

jobs:
rust-checks:
name: Rust Checks
runs-on: ubuntu-latest
strategy:
matrix:
rust-version: [stable, "1.75"] # Support recent stable and MSRV

steps:
- uses: actions/checkout@v4

- name: Install Rust ${{ matrix.rust-version }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust-version }}
components: rustfmt, clippy
override: true

- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ matrix.rust-version }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-${{ matrix.rust-version }}-
${{ runner.os }}-cargo-

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

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

- name: Build workspace
run: cargo build --workspace --verbose

build-and-test:
name: Build and Test End-to-End
runs-on: ubuntu-latest
needs: rust-checks

steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install uv
run: pip install uv

- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-stable-${{ hashFiles('**/Cargo.lock') }}

- name: Install reflectapi-cli
run: |
cargo install reflectapi-cli
- name: Run local CI script
run: |
chmod +x test-ci.sh
./test-ci.sh

documentation-check:
name: Documentation Check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Check README exists and is not empty
run: |
[ -f README.md ] && [ -s README.md ]
echo "✓ README.md exists and is not empty"

- name: Verify project structure matches documentation
run: |
echo "Checking project structure..."
[ -d rust_server ] || (echo "❌ rust_server directory missing" && exit 1)
[ -d reflect_server ] || (echo "❌ reflect_server directory missing" && exit 1)
[ -f main.py ] || (echo "❌ main.py missing" && exit 1)
[ -f reflect_main.py ] || (echo "❌ reflect_main.py missing" && exit 1)
echo "✓ Project structure matches documentation"

- name: Check for required files
run: |
echo "Checking for required configuration files..."
[ -f rust_server/Cargo.toml ] || (echo "❌ rust_server/Cargo.toml missing" && exit 1)
[ -f reflect_server/Cargo.toml ] || (echo "❌ reflect_server/Cargo.toml missing" && exit 1)
[ -f .gitignore ] || (echo "❌ .gitignore missing" && exit 1)
echo "✓ All required files present"
Loading