Skip to content

chore(deps): bump requests from 2.32.4 to 2.33.0 in the uv group across 1 directory #40

chore(deps): bump requests from 2.32.4 to 2.33.0 in the uv group across 1 directory

chore(deps): bump requests from 2.32.4 to 2.33.0 in the uv group across 1 directory #40

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write # For coverage comments
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: uv sync --group dev
- name: Lint with ruff
run: uv run ruff check .
- name: Check formatting with ruff
run: uv run ruff format --check .
- name: Type check with mypy
run: uv run mypy --install-types --non-interactive src/
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --group dev
- name: Run tests
run: uv run pytest --cov=pharia_telemetry --cov-report=xml --cov-report=term-missing --cov-report=html
- name: Upload coverage reports as artifacts
uses: actions/upload-artifact@v4
if: matrix.python-version == '3.11'
with:
name: coverage-reports
path: |
coverage.xml
htmlcov/
retention-days: 30
- name: Coverage comment
id: coverage_comment
if: matrix.python-version == '3.11' && github.event_name == 'pull_request'
run: |
# Extract coverage percentage
COVERAGE=$(python -c "
import xml.etree.ElementTree as ET
tree = ET.parse('coverage.xml')
root = tree.getroot()
coverage = root.attrib['line-rate']
print(f'{float(coverage)*100:.1f}')
")
echo "coverage=$COVERAGE" >> $GITHUB_OUTPUT
# Create coverage report
echo "## 📊 Coverage Report" > coverage_comment.md
echo "" >> coverage_comment.md
echo "**Overall Coverage: ${COVERAGE}%**" >> coverage_comment.md
echo "" >> coverage_comment.md
echo "### Details" >> coverage_comment.md
echo '```' >> coverage_comment.md
uv run pytest --cov=pharia_telemetry --cov-report=term-missing | tail -n +6 >> coverage_comment.md
echo '```' >> coverage_comment.md
echo "" >> coverage_comment.md
echo "📁 [View detailed HTML report in artifacts](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> coverage_comment.md
- name: Comment coverage on PR
if: matrix.python-version == '3.11' && github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const coverageComment = fs.readFileSync('coverage_comment.md', 'utf8');
// Look for existing coverage comment
const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
const botComment = comments.data.find(comment =>
comment.user.type === 'Bot' && comment.body.includes('📊 Coverage Report')
);
if (botComment) {
// Update existing comment
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: coverageComment
});
} else {
// Create new comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: coverageComment
});
}
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build package
run: uv build
- name: Check package
run: uv run twine check dist/*