UniProt MCP Server
by TakumiY235
- .github
- workflows
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Add permissions block
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Format code
run: |
black .
isort .
- name: Commit changes if any
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git diff --quiet || (git add . && git commit -m "Apply automatic formatting" && git push)
- name: Style checks
run: |
black --check .
isort --check .
flake8 .
mypy .
- name: Run tests
run: |
pytest
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install security tools
run: |
python -m pip install --upgrade pip
pip install bandit safety
- name: Run Bandit
run: |
bandit -r src/ -c pyproject.toml
- name: Check dependencies for known vulnerabilities
run: |
safety check
build:
needs: [test, security]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: |
python -m build