Files
labFusion/.gitea/workflows/frontend.yml
glenn schrooyen 4ca0fe02da
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
Implement CI/CD pipeline setup and enhance frontend and API Docs scripts; update progress tracking and project structure documentation
2025-09-12 00:22:15 +02:00

153 lines
3.4 KiB
YAML

name: Frontend (React)
on:
push:
paths:
- 'frontend/**'
- '.gitea/workflows/frontend.yml'
pull_request:
paths:
- 'frontend/**'
env:
REGISTRY: gitea.example.com
IMAGE_PREFIX: labfusion
SERVICE_NAME: frontend
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
strategy:
matrix:
node-version: [16, 18, 20]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run linting
run: |
npm run lint
npm run lint:fix --dry-run
- name: Run type checking
run: npm run type-check
- name: Run security audit
run: |
npm audit --audit-level=moderate
npm audit fix --dry-run
- name: Run tests
run: |
npm test -- --coverage --watchAll=false --passWithNoTests
npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./frontend/coverage/lcov.info
flags: frontend
name: frontend-coverage
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-frontend-node-${{ matrix.node-version }}
path: |
frontend/coverage/
frontend/test-results/
build:
runs-on: ubuntu-latest
needs: test
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: Build application
run: |
npm run build
npm run build:analyze
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: frontend-build
path: frontend/build/
- name: Build Docker image (test only)
run: docker build -t frontend:test .
lighthouse:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: frontend-build
path: frontend/build/
- name: Run Lighthouse CI
uses: treosh/lighthouse-ci-action@v10
with:
configPath: './frontend/.lighthouserc.json'
uploadArtifacts: true
temporaryPublicStorage: true
security:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: frontend:test
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'