Compare commits
7 Commits
af6fe5171f
...
d283fdcf82
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d283fdcf82 | ||
|
|
03e578fcdd | ||
|
|
ba0eb585e3 | ||
|
|
3c219f3d9a | ||
|
|
134de2679a | ||
|
|
8830a56ecb | ||
|
|
91e86c9785 |
61
.github/workflows/ci.yml
vendored
61
.github/workflows/ci.yml
vendored
@@ -64,9 +64,9 @@ jobs:
|
|||||||
- name: Upload build artifacts
|
- name: Upload build artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: dist-${{ matrix.node-version }}
|
name: dist
|
||||||
path: dist/
|
path: dist/
|
||||||
retention-days: 7
|
retention-days: 1
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -96,6 +96,12 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download build artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
path: dist/
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
@@ -116,6 +122,12 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download build artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
path: dist/
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
@@ -147,6 +159,12 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download build artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
path: dist/
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
@@ -169,7 +187,6 @@ jobs:
|
|||||||
|
|
||||||
lighthouse:
|
lighthouse:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [frontend]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -191,8 +208,8 @@ jobs:
|
|||||||
run: npm run test:lighthouse
|
run: npm run test:lighthouse
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
quality:
|
coverage:
|
||||||
name: Quality Gates
|
name: Coverage
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -217,12 +234,46 @@ jobs:
|
|||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
fail_ci_if_error: false
|
fail_ci_if_error: false
|
||||||
|
|
||||||
|
bundle-size:
|
||||||
|
name: Bundle Size
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "20"
|
||||||
|
cache: "npm"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: Check bundle size
|
- name: Check bundle size
|
||||||
run: npx bundlesize
|
run: npx bundlesize
|
||||||
|
|
||||||
|
security:
|
||||||
|
name: Security Audit
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "20"
|
||||||
|
cache: "npm"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
- name: Security audit
|
- name: Security audit
|
||||||
run: npm audit --audit-level=moderate
|
run: npm audit --audit-level=moderate
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|||||||
41
.github/workflows/nightly.yml
vendored
41
.github/workflows/nightly.yml
vendored
@@ -10,10 +10,9 @@ permissions:
|
|||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
nightly:
|
build:
|
||||||
name: Build Nightly Image
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: nightly
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -34,13 +33,37 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Install backend dependencies
|
|
||||||
working-directory: ./backend
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Upload build artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
path: dist/
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
date: ${{ steps.date.outputs.date }}
|
||||||
|
|
||||||
|
docker:
|
||||||
|
name: Build Nightly Image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
environment: nightly
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: master
|
||||||
|
|
||||||
|
- name: Download build artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
path: dist/
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
@@ -69,9 +92,9 @@ jobs:
|
|||||||
tags: |
|
tags: |
|
||||||
${{ secrets.DOCKERHUB_USERNAME }}/cv-app:nightly
|
${{ secrets.DOCKERHUB_USERNAME }}/cv-app:nightly
|
||||||
${{ secrets.DOCKERHUB_USERNAME }}/cv-app:edge
|
${{ secrets.DOCKERHUB_USERNAME }}/cv-app:edge
|
||||||
${{ secrets.DOCKERHUB_USERNAME }}/cv-app:${{ steps.date.outputs.date }}
|
${{ secrets.DOCKERHUB_USERNAME }}/cv-app:${{ needs.build.outputs.date }}
|
||||||
ghcr.io/${{ github.repository_owner }}/cv-app:nightly
|
ghcr.io/${{ github.repository_owner }}/cv-app:nightly
|
||||||
ghcr.io/${{ github.repository_owner }}/cv-app:edge
|
ghcr.io/${{ github.repository_owner }}/cv-app:edge
|
||||||
ghcr.io/${{ github.repository_owner }}/cv-app:${{ steps.date.outputs.date }}
|
ghcr.io/${{ github.repository_owner }}/cv-app:${{ needs.build.outputs.date }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|||||||
108
.github/workflows/release.yml
vendored
108
.github/workflows/release.yml
vendored
@@ -11,11 +11,72 @@ permissions:
|
|||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
lint:
|
||||||
name: Release
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "24"
|
||||||
|
cache: "npm"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
frontend-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "24"
|
||||||
|
cache: "npm"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: npm run test:run
|
||||||
|
|
||||||
|
backend-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "20.x"
|
||||||
|
|
||||||
|
- name: Install backend dependencies
|
||||||
|
working-directory: ./backend
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run backend tests
|
||||||
|
working-directory: ./backend
|
||||||
|
run: npm test
|
||||||
|
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [lint, frontend-test, backend-test]
|
||||||
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -32,23 +93,38 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Install backend dependencies
|
|
||||||
working-directory: ./backend
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Lint
|
|
||||||
run: npm run lint
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: npm run test:run
|
|
||||||
|
|
||||||
- name: Run backend tests
|
|
||||||
working-directory: ./backend
|
|
||||||
run: npm test
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Upload build artifacts
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
path: dist/
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Release
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build
|
||||||
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "24"
|
||||||
|
cache: "npm"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
24
.github/workflows/staging.yml
vendored
24
.github/workflows/staging.yml
vendored
@@ -10,10 +10,9 @@ permissions:
|
|||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
test:
|
||||||
name: Build & Deploy to Staging
|
name: Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: staging
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -38,6 +37,25 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npm run test:run
|
run: npm run test:run
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
name: Build & Deploy to Staging
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: test
|
||||||
|
environment: staging
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "24"
|
||||||
|
cache: "npm"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,13 @@
|
|||||||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"@semantic-release/github"
|
[
|
||||||
|
"@semantic-release/github",
|
||||||
|
{
|
||||||
|
"successComment": false,
|
||||||
|
"failComment": false,
|
||||||
|
"releasedLabels": false
|
||||||
|
}
|
||||||
|
]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
99
docs/plans/2026-02-23-ci-parallelization-design.md
Normal file
99
docs/plans/2026-02-23-ci-parallelization-design.md
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
# CI Parallelization Design
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Parallelize GitHub Actions workflows to reduce total CI time by running independent tasks concurrently and sharing build artifacts between jobs.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
- ci.yml
|
||||||
|
- release.yml
|
||||||
|
- staging.yml
|
||||||
|
- nightly.yml
|
||||||
|
|
||||||
|
## Approach
|
||||||
|
|
||||||
|
Use artifact sharing to avoid redundant builds. Frontend build artifacts are uploaded once and downloaded by dependent jobs.
|
||||||
|
|
||||||
|
## Design
|
||||||
|
|
||||||
|
### ci.yml
|
||||||
|
|
||||||
|
1. **Remove lighthouse dependency** - currently waits for frontend unnecessarily
|
||||||
|
2. **Upload frontend artifact** - `frontend` job uploads `dist/`
|
||||||
|
3. **Download artifact in test jobs** - `integration`, `e2e`, `regression` download instead of rebuilding
|
||||||
|
4. **Split quality job** into 3 parallel jobs:
|
||||||
|
- `coverage` - runs tests with coverage, uploads to Codecov
|
||||||
|
- `bundle-size` - checks bundle size limits
|
||||||
|
- `security` - runs npm audit
|
||||||
|
|
||||||
|
Job graph:
|
||||||
|
```
|
||||||
|
commitlint ──────┐
|
||||||
|
frontend ────────┼──► integration
|
||||||
|
backend ─────────┤
|
||||||
|
├──► e2e
|
||||||
|
├──► regression
|
||||||
|
│
|
||||||
|
lighthouse ──────┘ (parallel, no deps)
|
||||||
|
|
||||||
|
coverage ──────── (parallel)
|
||||||
|
bundle-size ───── (parallel)
|
||||||
|
security ──────── (parallel)
|
||||||
|
```
|
||||||
|
|
||||||
|
### release.yml
|
||||||
|
|
||||||
|
Split monolithic job into parallel jobs:
|
||||||
|
|
||||||
|
1. **lint** - runs npm run lint
|
||||||
|
2. **frontend-test** - runs npm run test:run
|
||||||
|
3. **backend-test** - runs backend npm test
|
||||||
|
4. **build** - waits for lint + tests, uploads dist artifact
|
||||||
|
5. **release** - semantic-release (waits for build)
|
||||||
|
6. **docker** - unchanged, waits for release
|
||||||
|
|
||||||
|
Job graph:
|
||||||
|
```
|
||||||
|
lint ──────────┐
|
||||||
|
frontend-test ─┼──► build ──► release ──► docker
|
||||||
|
backend-test ──┘
|
||||||
|
```
|
||||||
|
|
||||||
|
### staging.yml
|
||||||
|
|
||||||
|
Split into 2 jobs:
|
||||||
|
|
||||||
|
1. **test** - lint + frontend tests + backend tests in parallel steps
|
||||||
|
2. **deploy** - waits for test, builds and pushes docker
|
||||||
|
|
||||||
|
Job graph:
|
||||||
|
```
|
||||||
|
test ──► deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
### nightly.yml
|
||||||
|
|
||||||
|
Split into 2 jobs:
|
||||||
|
|
||||||
|
1. **build** - builds frontend, uploads artifact
|
||||||
|
2. **docker** - waits for build, pushes docker image
|
||||||
|
|
||||||
|
Job graph:
|
||||||
|
```
|
||||||
|
build ──► docker
|
||||||
|
```
|
||||||
|
|
||||||
|
## Implementation Notes
|
||||||
|
|
||||||
|
- Use `actions/upload-artifact@v4` and `actions/download-artifact@v4`
|
||||||
|
- Artifact retention: 1 day (sufficient for workflow duration)
|
||||||
|
- No changes to actual test/build logic, only workflow structure
|
||||||
|
|
||||||
|
## Implementation Complete
|
||||||
|
|
||||||
|
- [x] Task 1: ci.yml lighthouse parallelization and artifact sharing
|
||||||
|
- [x] Task 2: ci.yml quality job split into parallel jobs
|
||||||
|
- [x] Task 3: release.yml parallel lint, frontend-test, backend-test, build, release
|
||||||
|
- [x] Task 4: staging.yml split into test and deploy jobs
|
||||||
|
- [x] Task 5: nightly.yml split into build and docker jobs
|
||||||
Reference in New Issue
Block a user