Implement CI/CD pipeline setup and enhance frontend and API Docs scripts; update progress tracking and project structure documentation
Some checks failed
API Docs (Node.js Express) / test (18) (push) Failing after 22s
API Docs (Node.js Express) / test (20) (push) Failing after 22s
API Docs (Node.js Express) / build (push) Has been skipped
API Docs (Node.js Express) / security (push) Has been skipped
LabFusion CI/CD Pipeline / api-gateway (push) Failing after 4m53s
Docker Build and Push / build-and-push (push) Failing after 3m31s
Docker Build and Push / security-scan (push) Has been skipped
API Docs (Node.js Express) / test (16) (push) Failing after 3m7s
API Gateway (Java Spring Boot) / test (17) (push) Failing after 7m42s
API Gateway (Java Spring Boot) / test (21) (push) Failing after 5m11s
API Gateway (Java Spring Boot) / build (push) Has been skipped
API Gateway (Java Spring Boot) / security (push) Has been skipped
LabFusion CI/CD Pipeline / service-adapters (push) Failing after 6m30s
LabFusion CI/CD Pipeline / api-docs (push) Failing after 10s
LabFusion CI/CD Pipeline / frontend (push) Failing after 4m54s
LabFusion CI/CD Pipeline / integration-tests (push) Has been skipped
LabFusion CI/CD Pipeline / security-scan (push) Has been skipped
Frontend (React) / test (16) (push) Failing after 4m58s
Frontend (React) / test (18) (push) Failing after 4m58s
Frontend (React) / test (20) (push) Failing after 4m58s
Frontend (React) / build (push) Has been skipped
Frontend (React) / security (push) Has been skipped
Integration Tests / integration-tests (push) Failing after 35s
Integration Tests / performance-tests (push) Has been skipped
Service Adapters (Python FastAPI) / test (3.1) (push) Failing after 15s
Service Adapters (Python FastAPI) / test (3.11) (push) Failing after 5m23s
Service Adapters (Python FastAPI) / test (3.12) (push) Failing after 6m18s
Service Adapters (Python FastAPI) / test (3.9) (push) Failing after 6m18s
Docker Build and Push / deploy-staging (push) Has been skipped
Service Adapters (Python FastAPI) / build (push) Has been skipped
Service Adapters (Python FastAPI) / security (push) Has been skipped
Docker Build and Push / deploy-production (push) Has been skipped
Frontend (React) / lighthouse (push) Has been skipped
Some checks failed
API Docs (Node.js Express) / test (18) (push) Failing after 22s
API Docs (Node.js Express) / test (20) (push) Failing after 22s
API Docs (Node.js Express) / build (push) Has been skipped
API Docs (Node.js Express) / security (push) Has been skipped
LabFusion CI/CD Pipeline / api-gateway (push) Failing after 4m53s
Docker Build and Push / build-and-push (push) Failing after 3m31s
Docker Build and Push / security-scan (push) Has been skipped
API Docs (Node.js Express) / test (16) (push) Failing after 3m7s
API Gateway (Java Spring Boot) / test (17) (push) Failing after 7m42s
API Gateway (Java Spring Boot) / test (21) (push) Failing after 5m11s
API Gateway (Java Spring Boot) / build (push) Has been skipped
API Gateway (Java Spring Boot) / security (push) Has been skipped
LabFusion CI/CD Pipeline / service-adapters (push) Failing after 6m30s
LabFusion CI/CD Pipeline / api-docs (push) Failing after 10s
LabFusion CI/CD Pipeline / frontend (push) Failing after 4m54s
LabFusion CI/CD Pipeline / integration-tests (push) Has been skipped
LabFusion CI/CD Pipeline / security-scan (push) Has been skipped
Frontend (React) / test (16) (push) Failing after 4m58s
Frontend (React) / test (18) (push) Failing after 4m58s
Frontend (React) / test (20) (push) Failing after 4m58s
Frontend (React) / build (push) Has been skipped
Frontend (React) / security (push) Has been skipped
Integration Tests / integration-tests (push) Failing after 35s
Integration Tests / performance-tests (push) Has been skipped
Service Adapters (Python FastAPI) / test (3.1) (push) Failing after 15s
Service Adapters (Python FastAPI) / test (3.11) (push) Failing after 5m23s
Service Adapters (Python FastAPI) / test (3.12) (push) Failing after 6m18s
Service Adapters (Python FastAPI) / test (3.9) (push) Failing after 6m18s
Docker Build and Push / deploy-staging (push) Has been skipped
Service Adapters (Python FastAPI) / build (push) Has been skipped
Service Adapters (Python FastAPI) / security (push) Has been skipped
Docker Build and Push / deploy-production (push) Has been skipped
Frontend (React) / lighthouse (push) Has been skipped
This commit is contained in:
222
.gitea/workflows/ci.yml
Normal file
222
.gitea/workflows/ci.yml
Normal file
@@ -0,0 +1,222 @@
|
||||
name: LabFusion CI/CD Pipeline
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, develop ]
|
||||
pull_request:
|
||||
branches: [ main, develop ]
|
||||
|
||||
env:
|
||||
REGISTRY: gitea.example.com
|
||||
IMAGE_PREFIX: labfusion
|
||||
|
||||
jobs:
|
||||
# Java Spring Boot API Gateway
|
||||
api-gateway:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./services/api-gateway
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Cache Maven dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-m2
|
||||
|
||||
- name: Run tests
|
||||
run: mvn test
|
||||
|
||||
- name: Run code quality checks
|
||||
run: mvn spotbugs:check checkstyle:check
|
||||
|
||||
- name: Build application
|
||||
run: mvn clean package -DskipTests
|
||||
|
||||
- name: Build Docker image (test only)
|
||||
run: docker build -t api-gateway:test .
|
||||
|
||||
# Python FastAPI Service Adapters
|
||||
service-adapters:
|
||||
runs-on: ubuntu-latest
|
||||
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
|
||||
pip install pytest pytest-cov flake8 black isort
|
||||
|
||||
- name: Run code formatting check
|
||||
run: |
|
||||
black --check .
|
||||
isort --check-only .
|
||||
|
||||
- name: Run linting
|
||||
run: flake8 .
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
pytest --cov=. --cov-report=xml --cov-report=html
|
||||
|
||||
- name: Upload coverage reports
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
file: ./coverage.xml
|
||||
flags: service-adapters
|
||||
|
||||
- name: Build Docker image (test only)
|
||||
run: docker build -t service-adapters:test .
|
||||
|
||||
# Node.js API Documentation Service
|
||||
api-docs:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./services/api-docs
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js 18
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: services/api-docs/package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run linting
|
||||
run: npm run lint
|
||||
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
|
||||
- name: Build application
|
||||
run: npm run build
|
||||
|
||||
- name: Build Docker image (test only)
|
||||
run: docker build -t api-docs:test .
|
||||
|
||||
# React Frontend
|
||||
frontend:
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: ./frontend
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js 18
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'npm'
|
||||
cache-dependency-path: frontend/package-lock.json
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run linting
|
||||
run: npm run lint
|
||||
|
||||
- name: Run tests
|
||||
run: npm test -- --coverage --watchAll=false
|
||||
|
||||
- name: Build application
|
||||
run: npm run build
|
||||
|
||||
- name: Build Docker image (test only)
|
||||
run: docker build -t frontend:test .
|
||||
|
||||
# Integration Tests
|
||||
integration-tests:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [api-gateway, service-adapters, api-docs, frontend]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Start services with Docker Compose
|
||||
run: |
|
||||
docker-compose -f docker-compose.dev.yml up -d
|
||||
sleep 30 # Wait for services to start
|
||||
|
||||
- name: Run integration tests
|
||||
run: |
|
||||
# Test API Gateway health
|
||||
curl -f http://localhost:8080/actuator/health || exit 1
|
||||
|
||||
# Test Service Adapters health
|
||||
curl -f http://localhost:8000/health || exit 1
|
||||
|
||||
# Test API Docs health
|
||||
curl -f http://localhost:3000/health || exit 1
|
||||
|
||||
# Test Frontend build
|
||||
curl -f http://localhost:3001 || exit 1
|
||||
|
||||
- name: Stop services
|
||||
if: always()
|
||||
run: docker-compose -f docker-compose.dev.yml down
|
||||
|
||||
# Security and Quality Gates
|
||||
security-scan:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [api-gateway, service-adapters, api-docs, frontend]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Run Trivy vulnerability scanner
|
||||
uses: aquasecurity/trivy-action@master
|
||||
with:
|
||||
scan-type: 'fs'
|
||||
scan-ref: '.'
|
||||
format: 'sarif'
|
||||
output: 'trivy-results.sarif'
|
||||
|
||||
- name: Upload Trivy scan results
|
||||
uses: github/codeql-action/upload-sarif@v2
|
||||
if: always()
|
||||
with:
|
||||
sarif_file: 'trivy-results.sarif'
|
||||
Reference in New Issue
Block a user