7 Commits

Author SHA1 Message Date
Tuan-Dat Tran
d283fdcf82 fix(release): disable github plugin comments for gitea compatibility
Some checks failed
Release / lint (push) Successful in 5m2s
Release / frontend-test (push) Successful in 12m46s
Release / backend-test (push) Successful in 39s
Release / build (push) Has started running
Release / Release (push) Has been cancelled
Release / Build & Push Docker Image (push) Has been cancelled
Gitea does not have GitHub's GraphQL API, causing the success/fail
comment features to fail. Disable these features while keeping
release creation functionality.
2026-02-23 20:25:15 +01:00
Tuan-Dat Tran
03e578fcdd docs: update ci parallelization design with implementation status 2026-02-23 20:25:15 +01:00
Tuan-Dat Tran
ba0eb585e3 feat(ci): split nightly workflow into build and docker jobs with artifact sharing 2026-02-23 20:25:15 +01:00
Tuan-Dat Tran
3c219f3d9a feat(ci): split staging workflow into parallel test and deploy jobs 2026-02-23 20:25:15 +01:00
Tuan-Dat Tran
134de2679a feat(ci): parallelize release workflow with separate lint, test, and build jobs 2026-02-23 20:25:15 +01:00
Tuan-Dat Tran
8830a56ecb feat(ci): split quality job into parallel coverage, bundle-size, and security jobs 2026-02-23 20:25:15 +01:00
Tuan-Dat Tran
91e86c9785 feat(ci): parallelize lighthouse and add artifact sharing 2026-02-23 20:25:15 +01:00
6 changed files with 308 additions and 34 deletions

View File

@@ -64,9 +64,9 @@ jobs:
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.node-version }}
name: dist
path: dist/
retention-days: 7
retention-days: 1
backend:
runs-on: ubuntu-latest
@@ -96,6 +96,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Setup Node.js
uses: actions/setup-node@v4
with:
@@ -116,6 +122,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Setup Node.js
uses: actions/setup-node@v4
with:
@@ -147,6 +159,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Setup Node.js
uses: actions/setup-node@v4
with:
@@ -169,7 +187,6 @@ jobs:
lighthouse:
runs-on: ubuntu-latest
needs: [frontend]
steps:
- name: Checkout
@@ -191,8 +208,8 @@ jobs:
run: npm run test:lighthouse
continue-on-error: true
quality:
name: Quality Gates
coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
@@ -217,12 +234,46 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
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
run: npm run build
- name: Check bundle size
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
run: npm audit --audit-level=moderate
continue-on-error: true

View File

@@ -10,10 +10,9 @@ permissions:
packages: write
jobs:
nightly:
name: Build Nightly Image
build:
name: Build
runs-on: ubuntu-latest
environment: nightly
steps:
- name: Checkout
@@ -34,13 +33,37 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Install backend dependencies
working-directory: ./backend
run: npm ci
- name: 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
uses: docker/setup-qemu-action@v3
@@ -69,9 +92,9 @@ jobs:
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/cv-app:nightly
${{ 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: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-to: type=gha,mode=max

View File

@@ -11,11 +11,72 @@ permissions:
id-token: write
jobs:
release:
name: Release
lint:
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: 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:
- name: Checkout
uses: actions/checkout@v4
@@ -32,23 +93,38 @@ jobs:
- name: Install dependencies
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
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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -10,10 +10,9 @@ permissions:
packages: write
jobs:
build-and-deploy:
name: Build & Deploy to Staging
test:
name: Test
runs-on: ubuntu-latest
environment: staging
steps:
- name: Checkout
@@ -38,6 +37,25 @@ jobs:
- name: Run tests
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
run: npm run build

View File

@@ -61,6 +61,13 @@
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
"@semantic-release/github"
[
"@semantic-release/github",
{
"successComment": false,
"failComment": false,
"releasedLabels": false
}
]
]
}

View 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