fix: CI — pin IdeaGenerator import for mock targets + align S rule ig… #21
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] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint: | |
| runs-on: [self-hosted, Linux] | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Lint with ruff | |
| run: python3 -m ruff check src/ tests/ | |
| - name: Check formatting | |
| run: python3 -m ruff format --check src/ tests/ | |
| test: | |
| runs-on: [self-hosted, Linux] | |
| needs: lint | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Install package | |
| run: pip install --user --break-system-packages -e ".[test]" | |
| - name: Run tests | |
| run: python3 -m pytest tests/ -v --tb=short | |
| security: | |
| runs-on: [self-hosted, Linux] | |
| needs: lint | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Security lint | |
| run: python3 -m ruff check src/ --select S --ignore S101,S311,S314,S603,S607,S701 | |
| issue-test-ratio: | |
| runs-on: [self-hosted, Linux] | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Check issue-to-test ratio | |
| env: | |
| GH_REPO: rayketcham-lab/project-forge | |
| run: | | |
| ISSUE_COUNT=$(gh issue list -R "$GH_REPO" --state all --label feature --json number -q 'length' 2>/dev/null || echo 0) | |
| TEST_COUNT=$(python3 -m pytest tests/ --collect-only -q 2>/dev/null | tail -1 | grep -oP '\d+(?= test)' || echo 0) | |
| echo "Feature issues: $ISSUE_COUNT, Tests: $TEST_COUNT" | |
| if [ "$TEST_COUNT" -lt "$ISSUE_COUNT" ]; then | |
| echo "::warning::Test count ($TEST_COUNT) is below feature issue count ($ISSUE_COUNT)" | |
| fi |