Skip to content

Commit 6b18b2e

Browse files
authored
Add CI/CD pipeline configuration in ci.yml
Implemented GitHub Actions workflow for continuous integration including linting, testing with multiple Node versions, security scanning, and build automation for the Audityzer Platform.
1 parent fecfaa7 commit 6b18b2e

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
lint-and-test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Run linter
31+
run: npm run lint
32+
continue-on-error: true
33+
34+
- name: Run tests
35+
run: npm test
36+
37+
- name: Generate coverage report
38+
run: npm run test:coverage
39+
continue-on-error: true
40+
41+
security-scan:
42+
runs-on: ubuntu-latest
43+
44+
steps:
45+
- name: Checkout code
46+
uses: actions/checkout@v4
47+
48+
- name: Run security audit
49+
run: npm audit --audit-level=moderate
50+
continue-on-error: true
51+
52+
- name: Check for vulnerabilities
53+
run: npm audit fix --dry-run
54+
continue-on-error: true
55+
56+
build:
57+
runs-on: ubuntu-latest
58+
needs: [lint-and-test]
59+
60+
steps:
61+
- name: Checkout code
62+
uses: actions/checkout@v4
63+
64+
- name: Setup Node.js
65+
uses: actions/setup-node@v4
66+
with:
67+
node-version: '20.x'
68+
cache: 'npm'
69+
70+
- name: Install dependencies
71+
run: npm ci
72+
73+
- name: Build project
74+
run: npm run build
75+
continue-on-error: true

0 commit comments

Comments
 (0)