Skip to content

Main #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

Main #159

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
pipeline {
agent any

tools {
nodejs 'NodeJS-24'
}

environment {
CI = 'true'
NODE_ENV = 'test'
}

options {
buildDiscarder(logRotator(numToKeepStr: '10'))
timeout(time: 30, unit: 'MINUTES')
timestamps()
}

stages {
stage('Checkout') {
steps {
echo 'Checking out code...'
checkout scm
}
}

stage('Install Dependencies') {
steps {
echo 'Installing dependencies...'
sh '''
node --version
npm --version
npm ci
'''
}
}

stage('Code Quality & Security') {
parallel {
stage('Lint') {
steps {
echo 'Running ESLint...'
sh 'npm run lint || true'
}
}
stage('Security Audit') {
steps {
echo 'Running security audit...'
sh 'npm audit --audit-level moderate || true'
}
}
}
}

stage('Test') {
steps {
echo 'Running tests...'
sh '''
# Run tests with coverage
npm test -- --coverage --watchAll=false --testResultsProcessor=jest-junit
'''
}
post {
always {
// Publish test results
publishTestResults testResultsPattern: 'junit.xml'
// Publish coverage reports
publishHTML([
allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'coverage/lcov-report',
reportFiles: 'index.html',
reportName: 'Coverage Report'
])
}
}
}

stage('Build') {
steps {
echo 'Building application...'
sh 'npm run build'
}
post {
always {
archiveArtifacts artifacts: 'build/**/*', allowEmptyArchive: true
}
}
}
}

post {
always {
echo 'Pipeline completed'
cleanWs()
}
success {
echo 'Pipeline succeeded!'
}
failure {
echo 'Pipeline failed!'
}
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"lint": "eslint src/",
"eject": "react-scripts eject"
},
"browserslist": {
Expand Down