| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- name: Dependency Updates
- on:
- schedule:
- # Run every Monday at 9:00 AM UTC
- - cron: '0 9 * * 1'
- workflow_dispatch:
- permissions:
- contents: write
- pull-requests: write
- concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
- env:
- PYTHONUNBUFFERED: 1
- jobs:
- update-dependencies:
- name: Update Dependencies
- runs-on: ubuntu-latest
- timeout-minutes: 20
- steps:
- - name: Checkout repository
- uses: actions/checkout@v7
- with:
- # Use a Personal Access Token (PAT) named DEPENDENCY_UPDATE_TOKEN if
- # you want the created PR to trigger CI workflows (on: pull_request).
- # The default GITHUB_TOKEN suppresses further workflow runs on the PR.
- token: ${{ secrets.DEPENDENCY_UPDATE_TOKEN || secrets.GITHUB_TOKEN }}
- - name: Set up Python
- uses: actions/setup-python@v7.0.0
- with:
- python-version: "3.14"
- cache: 'pip'
- - name: Install system dependencies
- run: |
- sudo apt-get update
- sudo apt-get install -y build-essential libssl-dev libicapapi-dev python3-dev libpq-dev
- - name: Install pip-tools
- run: |
- python -m pip install --upgrade pip
- pip install pip-tools
- - name: Compile updated requirements
- id: compile
- run: |
- pip-compile \
- --upgrade \
- --output-file requirements.txt \
- requirements.in
- if git diff --quiet requirements.txt; then
- echo "dependencies_updated=false" >> "$GITHUB_OUTPUT"
- else
- echo "dependencies_updated=true" >> "$GITHUB_OUTPUT"
- {
- echo "diff<<DIFF_EOF"
- git diff -- requirements.txt | head -n 200
- if [ "$(git diff -- requirements.txt | wc -l)" -gt 200 ]; then
- echo ""
- echo "... (diff truncated to 200 lines)"
- fi
- echo "DIFF_EOF"
- } >> "$GITHUB_OUTPUT"
- fi
- - name: Install updated dependencies
- if: steps.compile.outputs.dependencies_updated == 'true'
- run: pip install -r requirements.txt
- - name: Run smoke tests
- if: steps.compile.outputs.dependencies_updated == 'true'
- run: |
- python - << 'EOF'
- import sys
- import os
- sys.path.insert(0, os.getcwd())
- try:
- from app import create_app
- from database.database import get_engine, create_dynamic_tables
- print("✅ Core imports OK")
- except Exception as e:
- print(f"❌ Import error: {e}")
- sys.exit(1)
- EOF
- - name: Run linting
- if: steps.compile.outputs.dependencies_updated == 'true'
- run: |
- pip install ruff
- ruff check . || echo "⚠️ Linting issues found"
- - name: Create Pull Request
- if: steps.compile.outputs.dependencies_updated == 'true'
- id: cpr
- uses: peter-evans/create-pull-request@v8
- with:
- token: ${{ secrets.DEPENDENCY_UPDATE_TOKEN || secrets.GITHUB_TOKEN }}
- commit-message: |
- chore: update dependencies
- Update pinned dependencies to their latest compatible versions.
- committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- signoff: false
- branch: dependency-updates
- delete-branch: true
- add-paths: |
- requirements.in
- requirements.txt
- title: "chore: Update dependencies"
- body: |
- ## Dependency Updates
- This PR updates the pinned dependencies to their latest compatible versions.
- ### Changes
- - Regenerated `requirements.txt` from `requirements.in` with `pip-compile --upgrade`
- - Core import smoke tests passed
- - Linting checked
- ### Diff
- ```diff
- ${{ steps.compile.outputs.diff }}
- ```
- ### Testing
- - [ ] Manual testing of key features
- - [ ] Performance impact evaluation
- - [ ] Security review of new versions
- ---
- *This PR was created automatically by the dependency update workflow.*
- labels: |
- dependencies
- automated
|