Fix final formatting issue in REST plugin #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main, master, develop ] | |
| pull_request: | |
| branches: [ main, master ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| test: | |
| name: Test Suite | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run tests | |
| run: cargo test --workspace --verbose | |
| - name: Run doctests | |
| run: cargo test --workspace --doc --verbose | |
| - name: Validate examples | |
| run: | | |
| echo "Validating SIGMOS examples structure..." | |
| # Check that examples directory exists and has files | |
| if [ ! -d "examples" ]; then | |
| echo "❌ Examples directory not found!" | |
| exit 1 | |
| fi | |
| # Count and list example files | |
| EXAMPLE_COUNT=$(find examples/ -name "*.sigmos" -type f | wc -l) | |
| echo "Found $EXAMPLE_COUNT example files:" | |
| find examples/ -name "*.sigmos" -type f | head -10 | |
| # Ensure we have examples | |
| if [ "$EXAMPLE_COUNT" -eq 0 ]; then | |
| echo "❌ No example files found!" | |
| exit 1 | |
| fi | |
| # Basic structure validation for each example | |
| for file in $(find examples/ -name "*.sigmos" -type f); do | |
| echo "Checking structure: $file" | |
| # Check file is not empty | |
| if [ ! -s "$file" ]; then | |
| echo "❌ Empty file: $file" | |
| exit 1 | |
| fi | |
| # Check file contains basic SIGMOS structure | |
| if ! grep -q "spec " "$file"; then | |
| echo "❌ Missing spec declaration in: $file" | |
| exit 1 | |
| fi | |
| if ! grep -q "description:" "$file"; then | |
| echo "❌ Missing description in: $file" | |
| exit 1 | |
| fi | |
| echo "✓ Structure valid: $file" | |
| done | |
| echo "✓ All $EXAMPLE_COUNT examples have valid structure!" | |
| fmt: | |
| name: Rustfmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Enforce formatting | |
| run: cargo fmt --check | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Linting (Zero Warnings Policy) | |
| run: cargo clippy --workspace --all-targets --all-features -- -D warnings | |
| docs: | |
| name: Docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Check documentation | |
| run: cargo doc --workspace --no-deps --document-private-items | |
| - name: Test documentation | |
| run: cargo test --workspace --doc | |
| security_audit: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit | |
| - name: Run audit | |
| run: cargo audit | |