Files
labFusion/.gitea/workflows/api-docs.yml
glenn schrooyen 6cdb4df779
Some checks failed
API Docs (Node.js Express) / test (16) (push) Failing after 5m3s
API Docs (Node.js Express) / test (18) (push) Failing after 5m3s
API Docs (Node.js Express) / test (20) (push) Failing after 43s
API Docs (Node.js Express) / build (push) Has been skipped
API Docs (Node.js Express) / security (push) Has been skipped
API Gateway (Java Spring Boot) / test (17) (push) Failing after 4m55s
API Gateway (Java Spring Boot) / test (21) (push) Failing after 4m55s
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 4m53s
LabFusion CI/CD Pipeline / service-adapters (push) Failing after 4m58s
LabFusion CI/CD Pipeline / api-docs (push) Failing after 4m56s
LabFusion CI/CD Pipeline / frontend (push) Failing after 5m58s
LabFusion CI/CD Pipeline / integration-tests (push) Has been skipped
LabFusion CI/CD Pipeline / security-scan (push) Has been skipped
Docker Build and Push / build-and-push (push) Failing after 32s
Docker Build and Push / security-scan (push) Has been skipped
Frontend (React) / test (16) (push) Failing after 6m3s
Frontend (React) / test (18) (push) Failing after 6m6s
Frontend (React) / test (20) (push) Failing after 1m37s
Frontend (React) / build (push) Has been skipped
Frontend (React) / security (push) Has been skipped
Integration Tests / integration-tests (push) Failing after 23s
Docker Build and Push / deploy-staging (push) Has been skipped
Integration Tests / performance-tests (push) Has been skipped
Docker Build and Push / deploy-production (push) Has been skipped
Frontend (React) / lighthouse (push) Has been skipped
Update CI workflows to use Maven wrapper for consistency and improve npm dependency installation logic; enhance progress tracking documentation
2025-09-12 02:22:16 +02:00

147 lines
3.4 KiB
YAML

name: API Docs (Node.js Express)
on:
push:
paths:
- 'services/api-docs/**'
- '.gitea/workflows/api-docs.yml'
pull_request:
paths:
- 'services/api-docs/**'
env:
REGISTRY: gitea.example.com
IMAGE_PREFIX: labfusion
SERVICE_NAME: api-docs
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./services/api-docs
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 }}
- name: Cache npm dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('services/api-docs/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-
${{ runner.os }}-node-
- 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 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
npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./services/api-docs/coverage/lcov.info
flags: api-docs
name: api-docs-coverage
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-node-${{ matrix.node-version }}
path: |
services/api-docs/coverage/
services/api-docs/test-results/
build:
runs-on: ubuntu-latest
needs: test
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'
- name: Cache npm dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-18-${{ hashFiles('services/api-docs/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
- name: Build Docker image (test only)
run: docker build -t api-docs:test .
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: api-docs: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'