Files
blackroad-operating-system/.github/workflows/python-tests.yml
Alexa Louise c00b6ee2a1 fix: Add Railway deployment configs and GitHub workflows
- Add Railway configuration (railway.toml)
- Add GitHub Actions workflows
  - Railway deployment automation
  - Python/Node.js testing
  - Health check monitoring
- Add GitHub templates (CODEOWNERS, PR template)
- Add requirements files if missing
- Standardize deployment across all services

This ensures consistent deployment patterns across the entire
BlackRoad OS infrastructure.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-10 15:35:09 -06:00

67 lines
2.0 KiB
YAML

name: Python Tests
on:
push:
branches: [main, master, develop]
pull_request:
branches: [main, master, develop]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Install all requirements files if they exist
for req in requirements.txt requirements-*.txt; do
if [ -f "$req" ]; then
echo "Installing $req..."
pip install -r "$req"
fi
done
- name: Lint with flake8
run: |
pip install flake8
# Stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# Exit-zero treats all errors as warnings
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
continue-on-error: true
- name: Test with pytest
if: ${{ hashFiles('pytest.ini') != '' || hashFiles('tests/') != '' }}
run: |
pip install pytest pytest-cov pytest-asyncio
pytest --cov=. --cov-report=xml --cov-report=term
continue-on-error: true
- name: Upload coverage to Codecov
if: ${{ hashFiles('pytest.ini') != '' || hashFiles('tests/') != '' }}
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
fail_ci_if_error: false