Files
labFusion/.gitea/workflows/service-adapters.yml
GSRN 4ae22d4f5f
Some checks failed
Docker Build and Push / build-and-push (push) Failing after 34s
API Docs (Node.js Express) / test (20) (push) Successful in 1m37s
API Gateway (Java Spring Boot) / test (17) (push) Failing after 6m16s
API Gateway (Java Spring Boot) / test (21) (push) Failing after 4m54s
API Gateway (Java Spring Boot) / build (push) Has been skipped
API Gateway (Java Spring Boot) / security (push) Has been skipped
API Docs (Node.js Express) / test (18) (push) Successful in 10m18s
API Docs (Node.js Express) / test (16) (push) Successful in 10m24s
LabFusion CI/CD Pipeline / api-gateway (push) Failing after 4m54s
LabFusion CI/CD Pipeline / service-adapters (push) Failing after 5m2s
LabFusion CI/CD Pipeline / frontend (push) Failing after 6m15s
Frontend (React) / test (16) (push) Failing after 6m11s
Frontend (React) / test (18) (push) Failing after 6m14s
Service Adapters (Python FastAPI) / test (3.1) (push) Failing after 14s
Integration Tests / integration-tests (push) Failing after 41s
Integration Tests / performance-tests (push) Has been skipped
Frontend (React) / test (20) (push) Failing after 1m49s
Frontend (React) / build (push) Has been skipped
LabFusion CI/CD Pipeline / api-docs (push) Successful in 9m57s
LabFusion CI/CD Pipeline / integration-tests (push) Has been skipped
Service Adapters (Python FastAPI) / test (3.11) (push) Failing after 5m18s
Frontend (React) / lighthouse (push) Has been skipped
Service Adapters (Python FastAPI) / test (3.12) (push) Failing after 5m28s
Service Adapters (Python FastAPI) / test (3.9) (push) Failing after 5m24s
Service Adapters (Python FastAPI) / build (push) Has been skipped
API Docs (Node.js Express) / build (push) Successful in 9m53s
Refactor CI workflows by removing security scan steps for API Docs, API Gateway, Frontend, and Service Adapters; update Docker build configurations for improved clarity and maintainability.
2025-09-15 09:42:07 +02:00

130 lines
3.8 KiB
YAML

name: Service Adapters (Python FastAPI)
on:
push:
paths:
- 'services/service-adapters/**'
- '.gitea/workflows/service-adapters.yml'
pull_request:
paths:
- 'services/service-adapters/**'
env:
REGISTRY: gitea.example.com
IMAGE_PREFIX: labfusion
SERVICE_NAME: service-adapters
jobs:
test:
runs-on: [self-hosted]
defaults:
run:
working-directory: ./services/service-adapters
strategy:
matrix:
python-version: [3.9, 3.10, 3.11, 3.12]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
${{ runner.os }}-
id: pip-cache
- name: Cache status
run: |
if [ "${{ steps.pip-cache.outputs.cache-hit }}" == "true" ]; then
echo "✅ Cache hit! Dependencies will be restored from cache."
else
echo "❌ Cache miss. Dependencies will be downloaded fresh."
fi
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --cache-dir ~/.cache/pip -r requirements.txt
pip install --cache-dir ~/.cache/pip pytest pytest-cov pytest-asyncio httpx
pip install --cache-dir ~/.cache/pip flake8 black isort mypy bandit safety
- name: Run code formatting check
run: |
black --check --diff .
isort --check-only --diff .
- name: Run linting
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --max-complexity=10 --max-line-length=150 --statistics
- name: Run type checking
run: mypy . --ignore-missing-imports
- name: Run security checks
run: |
bandit -r . -f json -o bandit-report.json
safety check --json --output safety-report.json
- name: Run tests
run: |
pytest --cov=. --cov-report=xml --cov-report=html --cov-report=term-missing
pytest --cov=. --cov-report=xml --cov-report=html --cov-report=term-missing --cov-fail-under=80
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./services/service-adapters/coverage.xml
flags: service-adapters
name: service-adapters-coverage
- name: Test results summary
if: always()
run: |
echo "Test results available in pipeline logs"
echo "Coverage report: services/service-adapters/coverage.xml"
echo "HTML coverage: services/service-adapters/htmlcov/"
echo "Security reports: bandit-report.json, safety-report.json"
build:
runs-on: [self-hosted]
needs: test
defaults:
run:
working-directory: ./services/service-adapters
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Cache pip dependencies
uses: actions/cache@v4
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
pip install -r requirements.txt
- name: Build Docker image (test only)
run: docker build -t service-adapters:test .