Skip to content

docs(vscode): align extension metadata for 3.8.6 #341

docs(vscode): align extension metadata for 3.8.6

docs(vscode): align extension metadata for 3.8.6 #341

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
release:
types: [published]
env:
PYTHON_VERSION: "3.11"
jobs:
lint:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
pip install -e ".[dev]"
pip install black==24.8.0
- name: Run Black
run: python -m black --check src/ tests/
- name: Run Ruff
run: ruff check src/ tests/
- name: Run MyPy
run: mypy src/
test:
name: Tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -e ".[dev]"
- name: Run tests
run: pytest --cov --cov-report=xml
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: python-${{ matrix.python-version }}
test-js:
name: JS/TS Analyzer (tree-sitter)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies with JS extras
run: pip install -e ".[dev,js]"
- name: Run JS/TS analyzer tests
run: pytest tests/test_js_analyzer.py -v
test-go:
name: Go Analyzer (tree-sitter)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies with Go extras
run: pip install -e ".[dev,go]"
- name: Run Go analyzer tests
run: pytest tests/test_go_analyzer.py -v
rust-accelerator:
name: Rust Accelerator
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python dependencies
run: pip install -e ".[dev]"
- name: Run Rust format check
run: cargo fmt --check --manifest-path rust/slop_scan/Cargo.toml
- name: Build Rust accelerator
run: cargo build --release --manifest-path rust/slop_scan/Cargo.toml
- name: Run Rust integration tests
env:
SLOP_RUST_SCAN_BIN: ${{ github.workspace }}/rust/slop_scan/target/release/slop_scan
run: pytest tests/test_rust_scan.py -v
npm-wrapper:
name: NPM Thin Wrapper
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python package
run: pip install -e .
- name: Run wrapper unit tests
working-directory: npm-wrapper
run: node --test tests/runtime.test.js
- name: Verify wrapper backend invocation
working-directory: npm-wrapper
run: node ./bin/ai-slop-detector.js --version
- name: Verify npm package surface
working-directory: npm-wrapper
run: npm pack --dry-run
slop-check:
name: Self SLOP Detection
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install package
run: pip install -e .
- name: Run SLOP detector on itself
run: |
slop-detector --project src/ --config .slopconfig.yaml --output slop_report.txt
- name: Check SLOP score
run: |
SCORE=$(slop-detector --project src/ --config .slopconfig.yaml --json | jq '.weighted_deficit_score')
echo "Weighted Deficit Score: $SCORE"
if (( $(echo "$SCORE > 30" | bc -l) )); then
echo "Deficit score too high: $SCORE"
exit 1
fi
- name: Upload SLOP report
uses: actions/upload-artifact@v4
if: always()
with:
name: slop-report
path: slop_report.txt
docker:
name: Build Docker Image
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
id: docker_login
if: github.event_name == 'release'
continue-on-error: true
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: flamehaven/ai-slop-detector
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name == 'release' && steps.docker_login.outcome == 'success' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max