diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..cc05b8a4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,96 @@ +name: CI + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true +on: + push: + branches: + - master + pull_request: + branches: + - master + workflow_dispatch: + +jobs: + build-workflow-example: + name: Build workflow example + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4.1.7 + - name: Set up Node.js + uses: actions/setup-node@v4.0.3 + with: + node-version: '18.x' + - name: Build + env: + NODE_OPTIONS: --max_old_space_size=4096 + run: yarn build:workflow + + build-node-json-theia: + name: Build node-json-theia + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4.1.7 + - name: Set up Node.js + uses: actions/setup-node@v4.0.3 + with: + node-version: '18.x' + - name: Build + env: + NODE_OPTIONS: --max_old_space_size=4096 + run: yarn build:node-json-theia + + build-node-json-vscode: + name: Build node-json-vscode + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4.1.7 + - name: Set up Node.js + uses: actions/setup-node@v4.0.3 + with: + node-version: '18.x' + - name: Build + run: yarn build:node-json-vscode + + build-java-emf-theia: + name: Build java-emf-theia + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4.1.7 + - name: Set up Node.js + uses: actions/setup-node@v4.0.3 + - name: Set up JDK + uses: actions/setup-java@v4.2.1 + with: + distribution: 'temurin' + java-version: '17' + - name: Build + env: + NODE_OPTIONS: --max_old_space_size=4096 + run: yarn build:java-emf-theia + + build-java-emf-eclipse: + name: Build java-emf-eclipse + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4.1.7 + - name: Set up Node.js + uses: actions/setup-node@v4.0.3 + - name: Set up JDK + uses: actions/setup-java@v4.2.1 + with: + distribution: 'temurin' + java-version: '17' + - name: Build + run: yarn build:java-emf-eclipse diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 6376aa95..00000000 --- a/Jenkinsfile +++ /dev/null @@ -1,340 +0,0 @@ -def kubernetes_config = """ -apiVersion: v1 -kind: Pod -spec: - containers: - - name: ci - image: eclipseglsp/ci:alpine-v5.0 - tty: true - resources: - limits: - memory: "2Gi" - cpu: "1" - requests: - memory: "2Gi" - cpu: "1" - command: - - cat - env: - - name: "MAVEN_OPTS" - value: "-Duser.home=/home/jenkins" - volumeMounts: - - mountPath: "/home/jenkins" - name: "jenkins-home" - readOnly: false - - mountPath: "/.yarn" - name: "yarn-global" - readOnly: false - - name: settings-xml - mountPath: /home/jenkins/.m2/settings.xml - subPath: settings.xml - readOnly: true - - name: m2-repo - mountPath: /home/jenkins/.m2/repository - volumes: - - name: "jenkins-home" - emptyDir: {} - - name: "yarn-global" - emptyDir: {} - - name: settings-xml - secret: - secretName: m2-secret-dir - items: - - key: settings.xml - path: settings.xml - - name: m2-repo - emptyDir: {} -""" -pipeline { - agent { - kubernetes { - label 'glsp-agent-pod' - yaml kubernetes_config - } - } - options { - buildDiscarder logRotator(numToKeepStr: '15') - } - - environment { - YARN_CACHE_FOLDER = "${env.WORKSPACE}/yarn-cache" - SPAWN_WRAP_SHIM_ROOT = "${env.WORKSPACE}" - EMAIL_TO= "glsp-build@eclipse.org" - PUPPETEER_SKIP_DOWNLOAD="true" - } - - stages { - - stage('Build Workflow Example') { - when { - expression { - sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^workflow/"') == 0 - } - } - stages { - stage('Build') { - steps { - timeout(30){ - container('ci') { - dir('workflow') { - sh 'yarn install --unsafe-perm' - } - } - } - } - } - } - } - - stage('Build java-emf-theia template') { - when { - expression { - sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^project-templates/java-emf-theia/\\(glsp-client\\|glsp-server\\)"') == 0 - } - } - stages { - stage('Build server'){ - steps{ - timeout(30){ - container('ci') { - dir('project-templates/java-emf-theia/glsp-server/'){ - sh "mvn clean verify -DskipTests -B -Dcheckstyle.skip" - } - } - } - } - } - stage('Build client'){ - steps{ - timeout(30){ - container('ci') { - dir('project-templates/java-emf-theia/glsp-client') { - sh 'yarn install --unsafe-perm' - } - } - } - } - } - } - } - - stage('Build node-json-theia template') { - when { - expression { - sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^project-templates/node-json-theia/"') == 0 - } - } - stages { - stage('Build'){ - steps{ - timeout(30){ - container('ci') { - dir('project-templates/node-json-theia') { - sh 'yarn install --unsafe-perm' - } - } - } - } - } - } - } - - stage('Build node-json-vscode template') { - when { - expression { - sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^project-templates/node-json-vscode/"') == 0 - } - } - stages { - stage('Build'){ - steps{ - timeout(30){ - container('ci') { - dir('project-templates/node-json-vscode') { - sh 'yarn install --unsafe-perm' - } - } - } - } - } - } - } - - stage('Build java-emf-eclipse template') { - when { - expression { - sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^project-templates/java-emf-eclipse/\\(glsp-client\\|glsp-server\\)"') == 0 - } - } - stages { - stage('Build client'){ - steps{ - timeout(30){ - container('ci') { - dir('project-templates/java-emf-eclipse/glsp-client') { - sh 'yarn install --unsafe-perm' - } - } - } - } - } - stage('Build server'){ - steps{ - timeout(30){ - container('ci') { - dir('project-templates/java-emf-eclipse/glsp-server/'){ - sh "mvn clean verify -DskipTests -B -Dcheckstyle.skip" - } - } - } - } - } - } - } - - stage('Codestyle') { - stages { - stage ('Lint workflow example') { - when { - expression { - sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^workflow/"') == 0 - } - } - steps { - timeout(30) { - container('ci') { - dir('workflow') { - sh 'yarn lint -o eslint.xml -f checkstyle' - } - } - } - } - } - - stage ('Lint java-emf-theia') { - when { - expression { - sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^project-templates/java-emf-theia/\\(glsp-client\\|glsp-server\\)"') == 0 - } - } - steps { - timeout(30) { - container('ci') { - dir('project-templates/java-emf-theia/glsp-server/'){ - sh 'mvn checkstyle:check' - } - dir('project-templates/java-emf-theia/glsp-client/'){ - sh 'yarn lint:ci' - } - } - } - } - } - - - stage ('Lint java-emf-eclipse') { - when { - expression { - sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^project-templates/java-emf-eclipse/\\(glsp-client\\|glsp-server\\)"') == 0 - } - } - steps { - timeout(30) { - container('ci') { - dir('project-templates/java-emf-eclipse/glsp-server/'){ - sh 'mvn checkstyle:check' - } - dir('project-templates/java-emf-eclipse/glsp-client/'){ - sh 'yarn lint:ci' - } - } - } - } - } - - stage ('Lint node-json-theia') { - when { - expression { - sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^project-templates/node-json-theia/"') == 0 - } - } - steps { - timeout(30) { - container('ci') { - dir('project-templates/node-json-theia/'){ - sh 'yarn lint:ci' - } - } - } - } - } - - stage ('Lint node-json-vscode') { - when { - expression { - sh(returnStatus: true, script: 'git diff --name-only HEAD^ | grep --quiet "^project-templates/node-json-vscode/"') == 0 - } - } - steps { - timeout(30) { - container('ci') { - dir('project-templates/node-json-vscode/'){ - sh 'yarn lint:ci' - } - } - } - } - } - } - } - } - - post{ - always{ - container('ci') { - // Record & publish checkstyle issues - recordIssues enabledForFailure: true, publishAllIssues: true, aggregatingResults: true, - tool: checkStyle(reportEncoding: 'UTF-8'), - qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]] - - // Record & publish esLint issues - recordIssues enabledForFailure: true, publishAllIssues: true, aggregatingResults: true, - tools: [esLint(pattern: '**/node_modules/**/*/eslint.xml')], - qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]] - - // Record maven,java warnings - recordIssues enabledForFailure: true, skipPublishingChecks:true, tools: [mavenConsole(), java()] - } - } - failure { - script { - if (env.BRANCH_NAME == 'master') { - echo "Build result FAILURE: Send email notification to ${EMAIL_TO}" - emailext attachLog: true, - body: 'Job: ${JOB_NAME}
Build Number: ${BUILD_NUMBER}
Build URL: ${BUILD_URL}', - mimeType: 'text/html', subject: 'Build ${JOB_NAME} (#${BUILD_NUMBER}) FAILURE', to: "${EMAIL_TO}" - } - } - } - unstable { - script { - if (env.BRANCH_NAME == 'master') { - echo "Build result UNSTABLE: Send email notification to ${EMAIL_TO}" - emailext attachLog: true, - body: 'Job: ${JOB_NAME}
Build Number: ${BUILD_NUMBER}
Build URL: ${BUILD_URL}', - mimeType: 'text/html', subject: 'Build ${JOB_NAME} (#${BUILD_NUMBER}) UNSTABLE', to: "${EMAIL_TO}" - } - } - } - fixed { - script { - if (env.BRANCH_NAME == 'master') { - echo "Build back to normal: Send email notification to ${EMAIL_TO}" - emailext attachLog: false, - body: 'Job: ${JOB_NAME}
Build Number: ${BUILD_NUMBER}
Build URL: ${BUILD_URL}', - mimeType: 'text/html', subject: 'Build ${JOB_NAME} back to normal (#${BUILD_NUMBER})', to: "${EMAIL_TO}" - } - } - } - } -} diff --git a/project-templates/java-emf-eclipse/glsp-server/pom.xml b/project-templates/java-emf-eclipse/glsp-server/pom.xml index 65823cbd..9126510d 100644 --- a/project-templates/java-emf-eclipse/glsp-server/pom.xml +++ b/project-templates/java-emf-eclipse/glsp-server/pom.xml @@ -34,6 +34,13 @@ HEAD + + + sonatype + Sonatype + https://oss.sonatype.org/content/groups/public + + diff --git a/project-templates/java-emf-eclipse/package.json b/project-templates/java-emf-eclipse/package.json index aa494a5f..330e34d5 100644 --- a/project-templates/java-emf-eclipse/package.json +++ b/project-templates/java-emf-eclipse/package.json @@ -6,6 +6,6 @@ "prepare":"yarn build", "build":"yarn build:client && yarn build:server", "build:client":"yarn --cwd glsp-client install", - "build:server":"cd glsp-server && mvn clean verify" + "build:server":"cd glsp-server && mvn --batch-mode clean verify" } } \ No newline at end of file diff --git a/project-templates/java-emf-theia/glsp-server/pom.xml b/project-templates/java-emf-theia/glsp-server/pom.xml index 03946d5e..e36525ec 100644 --- a/project-templates/java-emf-theia/glsp-server/pom.xml +++ b/project-templates/java-emf-theia/glsp-server/pom.xml @@ -33,6 +33,33 @@ HEAD + + + sonatype + Sonatype + https://oss.sonatype.org/content/groups/public + + + + + + oss.sonatype.org-snapshot + https://oss.sonatype.org/content/repositories/snapshots + + true + + + true + + + + sonatype + Sonatype + https://oss.sonatype.org/content/groups/public + + + + UTF-8 diff --git a/project-templates/java-emf-theia/package.json b/project-templates/java-emf-theia/package.json index 75d5e42f..cf8ff727 100644 --- a/project-templates/java-emf-theia/package.json +++ b/project-templates/java-emf-theia/package.json @@ -6,6 +6,6 @@ "prepare":"yarn build", "build":"yarn build:server && yarn build:client", "build:client":"yarn --cwd glsp-client install", - "build:server":"cd glsp-server && mvn clean verify" + "build:server":"cd glsp-server && mvn --batch-mode clean verify" } } \ No newline at end of file