Some checks failed
CI/CD Pipeline / unit-tests (push) Failing after 1m16s
CI/CD Pipeline / integration-tests (push) Failing after 2m32s
CI/CD Pipeline / lint (push) Successful in 5m22s
CI/CD Pipeline / e2e-tests (push) Has been skipped
CI/CD Pipeline / build (push) Has been skipped
158 lines
4.3 KiB
YAML
158 lines
4.3 KiB
YAML
name: CI/CD Pipeline
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, develop ]
|
|
pull_request:
|
|
branches: [ main, develop ]
|
|
|
|
jobs:
|
|
# Lint and Type Check
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: control-plane-ui/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
working-directory: ./control-plane-ui
|
|
run: npm ci
|
|
|
|
- name: Run ESLint
|
|
working-directory: ./control-plane-ui
|
|
run: npm run lint || true
|
|
|
|
# Unit Tests
|
|
unit-tests:
|
|
runs-on: ubuntu-latest
|
|
needs: lint
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: control-plane-ui/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
working-directory: ./control-plane-ui
|
|
run: npm ci
|
|
|
|
- name: Run unit tests
|
|
working-directory: ./control-plane-ui
|
|
run: npm run test:run
|
|
|
|
- name: Generate coverage
|
|
working-directory: ./control-plane-ui
|
|
run: npm run test:coverage
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
files: ./control-plane-ui/coverage/coverage-final.json
|
|
flags: unittests
|
|
name: unit-test-coverage
|
|
|
|
# Integration Tests
|
|
integration-tests:
|
|
runs-on: ubuntu-latest
|
|
needs: lint
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: control-plane-ui/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
working-directory: ./control-plane-ui
|
|
run: npm ci
|
|
|
|
- name: Run integration tests
|
|
working-directory: ./control-plane-ui
|
|
run: npm run test:integration
|
|
|
|
# E2E Tests
|
|
e2e-tests:
|
|
runs-on: ubuntu-latest
|
|
needs: [unit-tests, integration-tests]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: control-plane-ui/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
working-directory: ./control-plane-ui
|
|
run: npm ci
|
|
|
|
- name: Install Playwright browsers
|
|
working-directory: ./control-plane-ui
|
|
run: npx playwright install --with-deps chromium
|
|
|
|
- name: Install Playwright system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2
|
|
|
|
- name: Build application
|
|
working-directory: ./control-plane-ui
|
|
run: npm run build
|
|
|
|
- name: Run E2E tests
|
|
working-directory: ./control-plane-ui
|
|
run: npm run test:e2e
|
|
env:
|
|
CI: true
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
if: always()
|
|
with:
|
|
name: playwright-report
|
|
path: control-plane-ui/playwright-report/
|
|
retention-days: 30
|
|
|
|
# Build
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
needs: [unit-tests, integration-tests]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
cache-dependency-path: control-plane-ui/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
working-directory: ./control-plane-ui
|
|
run: npm ci
|
|
|
|
- name: Build application
|
|
working-directory: ./control-plane-ui
|
|
run: npm run build
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: build-artifacts
|
|
path: control-plane-ui/dist/
|
|
retention-days: 7
|