Some checks failed
Frontend (React) / build (push) Has been skipped
API Gateway (Java Spring Boot) / test (17) (push) Failing after 34s
Docker Build and Push / build-and-push (push) Failing after 39s
API Gateway (Java Spring Boot) / test (21) (push) Failing after 33s
API Gateway (Java Spring Boot) / build (push) Has been skipped
API Gateway (Java Spring Boot) / security (push) Has been skipped
LabFusion CI/CD Pipeline / api-gateway (push) Failing after 30s
API Docs (Node.js Express) / test (20) (push) Successful in 1m41s
API Docs (Node.js Express) / test (16) (push) Successful in 1m48s
API Docs (Node.js Express) / test (18) (push) Successful in 1m47s
Frontend (React) / test (latest) (push) Failing after 54s
LabFusion CI/CD Pipeline / service-adapters (push) Successful in 1m5s
LabFusion CI/CD Pipeline / frontend (push) Failing after 1m3s
Frontend (React) / lighthouse (push) Has been skipped
LabFusion CI/CD Pipeline / api-docs (push) Successful in 1m57s
LabFusion CI/CD Pipeline / integration-tests (push) Has been skipped
API Docs (Node.js Express) / build (push) Successful in 59s
Integration Tests / integration-tests (push) Failing after 1m31s
Integration Tests / performance-tests (push) Has been skipped
### Summary of Changes - Updated Docker images for PostgreSQL and Redis to use `latest` tags in `docker-compose.dev.yml` and `docker-compose.yml`. - Modified Node.js version in the frontend CI workflow to `latest` in `frontend.yml`. - Updated all dependencies in `package.json` and `package-lock.json` for the frontend and API docs services to `latest` versions. ### Expected Results - Ensured that the project uses the most recent versions of dependencies, improving security and performance. - Enhanced compatibility with the latest features and fixes from the respective libraries and services.
163 lines
4.0 KiB
YAML
163 lines
4.0 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: [self-hosted]
|
|
env:
|
|
RUNNER_TOOL_CACHE: /toolcache
|
|
defaults:
|
|
run:
|
|
working-directory: ./frontend
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [latest]
|
|
|
|
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 }}
|
|
|
|
- name: Cache npm dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.npm
|
|
node_modules
|
|
~/.cache/node-gyp
|
|
key: npm-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('frontend/package-lock.json') }}
|
|
restore-keys: |
|
|
npm-${{ runner.os }}-${{ matrix.node-version }}-
|
|
npm-${{ runner.os }}-
|
|
npm-
|
|
fail-on-cache-miss: false
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
if [ -f package-lock.json ]; then
|
|
npm ci
|
|
else
|
|
npm install
|
|
fi
|
|
|
|
- name: Run linting
|
|
run: |
|
|
npm run lint
|
|
npm run lint:fix --dry-run
|
|
|
|
- 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 --coverageReporters=lcov --coverageReporters=text --coverageReporters=html
|
|
npm run test:coverage
|
|
|
|
- name: Send results to SonarQube
|
|
run: |
|
|
echo "Sending Frontend results to SonarQube..."
|
|
# Install SonarQube Scanner for Node.js
|
|
npm install -g @sonar/scan
|
|
|
|
# Run SonarQube analysis
|
|
sonar-scanner \
|
|
-Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \
|
|
-Dsonar.login=${{ secrets.SONAR_TOKEN }} \
|
|
-Dsonar.projectKey=labfusion-frontend \
|
|
-Dsonar.projectName=LabFusion Frontend
|
|
|
|
- name: Test results summary
|
|
if: always()
|
|
run: |
|
|
echo "Test results available in pipeline logs"
|
|
echo "Coverage report: frontend/coverage/"
|
|
echo "Jest test results: frontend/test-results/"
|
|
|
|
build:
|
|
runs-on: [self-hosted]
|
|
needs: test
|
|
defaults:
|
|
run:
|
|
working-directory: ./frontend
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js latest
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 'latest'
|
|
|
|
- name: Cache npm dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-node-18-${{ hashFiles('frontend/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node-18-
|
|
${{ runner.os }}-node-
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
if [ -f package-lock.json ]; then
|
|
npm ci
|
|
else
|
|
npm install
|
|
fi
|
|
|
|
- name: Build application
|
|
run: |
|
|
npm run build
|
|
npm run build:analyze
|
|
|
|
- name: Build artifacts summary
|
|
run: |
|
|
echo "Build artifacts created in frontend/build/"
|
|
echo "Build analysis available in pipeline logs"
|
|
|
|
- name: Build Docker image (test only)
|
|
run: docker build -t frontend:test .
|
|
|
|
lighthouse:
|
|
runs-on: [self-hosted]
|
|
needs: build
|
|
if: github.event_name == 'pull_request'
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build application for Lighthouse
|
|
run: |
|
|
cd frontend
|
|
npm ci
|
|
npm run build
|
|
|
|
- name: Run Lighthouse CI
|
|
uses: treosh/lighthouse-ci-action@v10
|
|
with:
|
|
configPath: './frontend/.lighthouserc.json'
|
|
uploadArtifacts: true
|
|
temporaryPublicStorage: true
|