Skip to content

fix(config,platform): improve error handling for missing system depen… #14

fix(config,platform): improve error handling for missing system depen…

fix(config,platform): improve error handling for missing system depen… #14

Workflow file for this run

name: Test Suite
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true
- name: Configure Poetry PATH (Windows)
if: runner.os == 'Windows'
run: |
echo "$env:USERPROFILE\.local\bin" >> $env:GITHUB_PATH
echo "$env:APPDATA\Python\Scripts" >> $env:GITHUB_PATH
- name: Verify Poetry installation
run: |
poetry --version
poetry config --list
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --with test,dev
- name: Run linting
run: |
poetry run ruff check commandrex/
- name: Run unit tests
run: |
poetry run pytest tests/unit -v -m unit --no-cov
- name: Run integration tests
run: |
poetry run pytest tests/integration -v -m integration --no-cov
- name: Run end-to-end tests
run: |
poetry run pytest tests/e2e -v -m e2e --no-cov
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
security-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install --with test,dev
- name: Run security scan with bandit
run: |
poetry run pip install bandit[toml]
poetry run bandit -r commandrex/ -f json -o bandit-report.json || true
- name: Upload security scan results
uses: actions/upload-artifact@v4
if: always()
with:
name: security-scan-results
path: bandit-report.json
type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install --with test,dev
- name: Run type checking with mypy
run: |
poetry run pip install mypy types-requests
poetry run mypy commandrex/ --ignore-missing-imports || true
test-coverage:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install --with test,dev
- name: Run full test suite with coverage
run: |
poetry run pytest tests/ --cov=commandrex --cov-report=html --cov-report=xml --cov-fail-under=80 -v
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: htmlcov/
- name: Comment coverage on PR
if: github.event_name == 'pull_request'
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ github.token }}
MINIMUM_GREEN: 80
MINIMUM_ORANGE: 70