Add Jenkins CI pipeline and Node.js automated tests
startup-product-gitea-ci/pipeline/head This commit looks good
startup-product-gitea-ci/pipeline/head This commit looks good
This commit is contained in:
Vendored
+49
@@ -0,0 +1,49 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
options {
|
||||
disableConcurrentBuilds()
|
||||
timeout(time: 5, unit: 'MINUTES')
|
||||
buildDiscarder(logRotator(numToKeepStr: '5'))
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
|
||||
stage('Verify Node.js') {
|
||||
steps {
|
||||
sh 'node --version'
|
||||
sh 'npm --version'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Syntax Check') {
|
||||
steps {
|
||||
dir('app') {
|
||||
sh 'npm run check'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Automated Tests') {
|
||||
steps {
|
||||
dir('app') {
|
||||
sh 'npm test'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
success {
|
||||
echo 'CI PASSED: All checks completed successfully.'
|
||||
}
|
||||
failure {
|
||||
echo 'CI FAILED: Review the Jenkins console output.'
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user