Skip to content

chore(deps): bump ruff from 0.15.0 to 0.15.2 #75

chore(deps): bump ruff from 0.15.0 to 0.15.2

chore(deps): bump ruff from 0.15.0 to 0.15.2 #75

Workflow file for this run

# ====================================================================================
# CI Workflow - Ralphy Looper
# ====================================================================================
#
# Runs linting, type checking, and tests in parallel on every push to main and on
# pull requests. On main-branch failures, automatically creates GitHub issues.
# On main-branch success, automatically closes any open CI failure issues.
#
# Security note: This workflow only uses safe GitHub context values in expressions
# (github.ref, github.server_url, github.repository, github.run_id, needs.*.result).
# No user-controllable inputs (issue titles, PR bodies, commit messages, etc.) are
# interpolated into run: commands.
#
# ====================================================================================
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
# Cancel in-progress runs for the same branch/PR to save resources
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
# Permissions needed for issue management on failure/success
permissions:
contents: read
issues: write
env:
POETRY_VERSION: "2.2.1"
jobs:
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Lint - Code style and formatting checks
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
- name: Cache Poetry virtualenv
uses: actions/cache@v5
with:
path: .venv
key: venv-${{ runner.os }}-py3.11-poetry${{ env.POETRY_VERSION }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
venv-${{ runner.os }}-py3.11-poetry${{ env.POETRY_VERSION }}-
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Run ruff check
run: poetry run ruff check ralph/ tests/
- name: Run ruff format check
run: poetry run ruff format --check ralph/ tests/
- name: Run markdownlint
uses: DavidAnson/markdownlint-cli2-action@v22
with:
globs: '**/*.md'
fix: false
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Shell Lint - Static analysis of shell scripts
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
shell-lint:
name: Shell Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Run shellcheck
uses: ludeeus/action-shellcheck@2.0.0
with:
scandir: '.github/scripts'
additional_files: 'tests/e2e/mock_backends/*.sh'
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Typecheck - Static type analysis with mypy
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
typecheck:
name: Type Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
- name: Cache Poetry virtualenv
uses: actions/cache@v5
with:
path: .venv
key: venv-${{ runner.os }}-py3.11-poetry${{ env.POETRY_VERSION }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
venv-${{ runner.os }}-py3.11-poetry${{ env.POETRY_VERSION }}-
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Run mypy
run: poetry run mypy ralph/
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Test - Unit and integration tests with pytest (multi-Python matrix)
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
test:
name: Test (py${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true
- name: Cache Poetry virtualenv
uses: actions/cache@v5
with:
path: .venv
key: venv-${{ runner.os }}-py${{ matrix.python-version }}-poetry${{ env.POETRY_VERSION }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
venv-${{ runner.os }}-py${{ matrix.python-version }}-poetry${{ env.POETRY_VERSION }}-
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Run tests with coverage
run: poetry run pytest --cov=ralph --cov-report=term-missing --cov-report=xml:coverage.xml
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v6
with:
name: coverage-report-py${{ matrix.python-version }}
path: coverage.xml
retention-days: 7
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# CI Summary - Aggregates results and handles success/failure automation
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ci-summary:
name: CI Summary
runs-on: ubuntu-latest
if: always()
needs: [lint, shell-lint, typecheck, test]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Make scripts executable
run: chmod +x .github/scripts/ci/*.sh .github/scripts/issues/*.sh
- name: Determine overall result
id: result
env:
LINT_RESULT: ${{ needs.lint.result }}
SHELL_LINT_RESULT: ${{ needs.shell-lint.result }}
TYPECHECK_RESULT: ${{ needs.typecheck.result }}
TEST_RESULT: ${{ needs.test.result }}
run: |
echo "lint=${LINT_RESULT}" >> "$GITHUB_OUTPUT"
echo "shell-lint=${SHELL_LINT_RESULT}" >> "$GITHUB_OUTPUT"
echo "typecheck=${TYPECHECK_RESULT}" >> "$GITHUB_OUTPUT"
echo "test=${TEST_RESULT}" >> "$GITHUB_OUTPUT"
if [[ "${LINT_RESULT}" == "success" && \
"${SHELL_LINT_RESULT}" == "success" && \
"${TYPECHECK_RESULT}" == "success" && \
"${TEST_RESULT}" == "success" ]]; then
echo "overall=success" >> "$GITHUB_OUTPUT"
else
echo "overall=failure" >> "$GITHUB_OUTPUT"
fi
- name: Print summary
env:
LINT_RESULT: ${{ needs.lint.result }}
SHELL_LINT_RESULT: ${{ needs.shell-lint.result }}
TYPECHECK_RESULT: ${{ needs.typecheck.result }}
TEST_RESULT: ${{ needs.test.result }}
OVERALL_RESULT: ${{ steps.result.outputs.overall }}
run: |
echo "## CI Results" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "| Job | Status |" >> "$GITHUB_STEP_SUMMARY"
echo "|-----|--------|" >> "$GITHUB_STEP_SUMMARY"
echo "| Lint | \`${LINT_RESULT}\` |" >> "$GITHUB_STEP_SUMMARY"
echo "| Shell Lint | \`${SHELL_LINT_RESULT}\` |" >> "$GITHUB_STEP_SUMMARY"
echo "| Type Check | \`${TYPECHECK_RESULT}\` |" >> "$GITHUB_STEP_SUMMARY"
echo "| Test | \`${TEST_RESULT}\` |" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
if [[ "${OVERALL_RESULT}" == "success" ]]; then
echo "**Overall: All checks passed.**" >> "$GITHUB_STEP_SUMMARY"
else
echo "**Overall: One or more checks failed.**" >> "$GITHUB_STEP_SUMMARY"
fi
# --- Failure handling (main branch only) ---
- name: Handle lint failure
if: >-
always() &&
github.ref == 'refs/heads/main' &&
needs.lint.result == 'failure'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: .github/scripts/ci/on-failure.sh "lint" "${RUN_URL}"
- name: Handle typecheck failure
if: >-
always() &&
github.ref == 'refs/heads/main' &&
needs.typecheck.result == 'failure'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: .github/scripts/ci/on-failure.sh "typecheck" "${RUN_URL}"
- name: Handle shell-lint failure
if: >-
always() &&
github.ref == 'refs/heads/main' &&
needs.shell-lint.result == 'failure'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: .github/scripts/ci/on-failure.sh "shell-lint" "${RUN_URL}"
- name: Handle test failure
if: >-
always() &&
github.ref == 'refs/heads/main' &&
needs.test.result == 'failure'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: .github/scripts/ci/on-failure.sh "test" "${RUN_URL}"
# --- Success handling (main branch only) ---
- name: Handle lint success
if: >-
always() &&
github.ref == 'refs/heads/main' &&
needs.lint.result == 'success'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: .github/scripts/ci/on-success.sh "lint"
- name: Handle typecheck success
if: >-
always() &&
github.ref == 'refs/heads/main' &&
needs.typecheck.result == 'success'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: .github/scripts/ci/on-success.sh "typecheck"
- name: Handle shell-lint success
if: >-
always() &&
github.ref == 'refs/heads/main' &&
needs.shell-lint.result == 'success'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: .github/scripts/ci/on-success.sh "shell-lint"
- name: Handle test success
if: >-
always() &&
github.ref == 'refs/heads/main' &&
needs.test.result == 'success'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: .github/scripts/ci/on-success.sh "test"
# --- Upload failure artifacts ---
- name: Upload failure artifacts
if: always() && steps.result.outputs.overall == 'failure'
uses: actions/upload-artifact@v6
with:
name: ci-failure-context
path: |
.github/scripts/
pyproject.toml
retention-days: 5
# --- Final gate ---
- name: Fail if any job failed
if: always() && steps.result.outputs.overall == 'failure'
run: |
echo "::error::CI failed. See individual job results above."
exit 1