This is an automated email from the ASF dual-hosted git repository.
shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git
The following commit(s) were added to refs/heads/master by this push:
new 05abc31 UNOMI-429 Move CI from Jenkins to GitHub actions (#249)
05abc31 is described below
commit 05abc31b7afe8cb52b83ed77bb224af6ef7b39ab
Author: MT BENTERKI <[email protected]>
AuthorDate: Wed Feb 10 15:57:57 2021 +0100
UNOMI-429 Move CI from Jenkins to GitHub actions (#249)
* Create configuration for GHA CI
* Remove Jenkins files
* Update GraphQLListIT.java
---
.github/workflows/unomi-ci-build-tests.yml | 32 ++++
.github/workflows/unomi-ci-docs-deploy.yml | 30 ++++
Jenkinsfile | 181 ---------------------
Jenkinsfile-jdk11 | 157 ------------------
.../apache/unomi/itests/graphql/GraphQLListIT.java | 4 +-
5 files changed, 65 insertions(+), 339 deletions(-)
diff --git a/.github/workflows/unomi-ci-build-tests.yml
b/.github/workflows/unomi-ci-build-tests.yml
new file mode 100644
index 0000000..d80b82e
--- /dev/null
+++ b/.github/workflows/unomi-ci-build-tests.yml
@@ -0,0 +1,32 @@
+# This workflow will build a Java project with Maven
+# For more information see:
https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+
+name: Unomi CI - Build and tests
+
+on:
+ push:
+ branches: [ master, unomi-1.5.x ]
+ pull_request:
+ branches: [ master ]
+
+jobs:
+ build-and-tests:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ java: [ 1.8, 11]
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK ${{ matrix.java }}
+ uses: actions/setup-java@v1
+ with:
+ java-version: ${{ matrix.java }}
+
+ - name: Build
+ run: mvn -U -B -e clean install -DskipTests
+
+ - name: Tests
+ run: mvn test
+
+ - name: Integration tests
+ run: mvn -pl itests clean install -Pintegration-tests
diff --git a/.github/workflows/unomi-ci-docs-deploy.yml
b/.github/workflows/unomi-ci-docs-deploy.yml
new file mode 100644
index 0000000..8a96215
--- /dev/null
+++ b/.github/workflows/unomi-ci-docs-deploy.yml
@@ -0,0 +1,30 @@
+# This workflow will build a Java project with Maven
+# For more information see:
https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+
+name: Unomi CI - Documentation and deployment
+
+on:
+ push:
+ branches: [ master, unomi-1.5.x ]
+
+jobs:
+ docs-and-deploy:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK 1.8
+ uses: actions/setup-java@v1
+ with:
+ java-version: 1.8
+ server-id: apache.snapshots.https
+ server-username: NEXUS_USER
+ server-password: NEXUS_PW
+
+ - name: Generate documentation
+ run: mvn javadoc:aggregate source:aggregate
+
+ - name: Deploying
+ run: mvn deploy -DskipTests
+ env:
+ NEXUS_USER: ${{ secrets.NEXUS_USER }}
+ NEXUS_PW: ${{ secrets.NEXUS_PW }}
diff --git a/Jenkinsfile b/Jenkinsfile
deleted file mode 100644
index e3b1599..0000000
--- a/Jenkinsfile
+++ /dev/null
@@ -1,181 +0,0 @@
-#!groovy
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-pipeline {
-
- agent {
- node {
- label 'ubuntu'
- }
- }
-
- environment {
- // ... setup any environment variables ...
- MVN_LOCAL_REPO_OPT = '-Dmaven.repo.local=.repository'
- MVN_TEST_FAIL_IGNORE = '-Dmaven.test.failure.ignore=true'
- }
-
- tools {
- // ... tell Jenkins what java version, maven version or other tools
are required ...
- maven 'maven_3_latest'
- jdk 'jdk_1.8_latest'
- }
-
- options {
- // Configure an overall timeout for the build of one hour.
- timeout(time: 1, unit: 'HOURS')
- // When we have test-fails e.g. we don't need to run the remaining
steps
- skipStagesAfterUnstable()
- buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr:
'5'))
- }
-
- stages {
- stage('Initialization') {
- steps {
- echo 'Building Branch: ' + env.BRANCH_NAME
- echo 'Using PATH = ' + env.PATH
- }
- }
-
- stage('Cleanup') {
- steps {
- echo 'Cleaning up the workspace'
- deleteDir()
- }
- }
-
- stage('Checkout') {
- steps {
- echo 'Checking out branch ' + env.BRANCH_NAME
- checkout scm
- }
- }
-
- stage('Build') {
- steps {
- echo 'Building'
- sh 'mvn -U -B -e clean install -DskipTests'
- }
- }
-
- stage('Tests') {
- steps {
- echo 'Running tests'
- sh 'mvn test'
- }
- post {
- always {
- junit(testResults: '**/surefire-reports/*.xml',
allowEmptyResults: true)
- junit(testResults: '**/failsafe-reports/*.xml',
allowEmptyResults: true)
- }
- }
- }
-
- stage('Integration tests') {
- steps {
- echo 'Running integration tests'
- sh 'mvn -pl itests clean install -Pintegration-tests'
- }
- }
-
- stage('Generate doc') {
- when {
- expression {
- env.BRANCH_NAME ==~ /(unomi-1.4.x|unomi-1.5.x|master)/
- }
- }
- steps {
- echo 'Generate documentation'
- sh 'mvn javadoc:aggregate source:aggregate'
- }
- }
-
- stage('Deploy') {
- when {
- expression {
- env.BRANCH_NAME ==~ /(unomi-1.4.x|unomi-1.5.x|master)/
- }
- }
- steps {
- echo 'Deploying'
- sh 'mvn deploy -DskipTests'
- }
- }
- }
-
- // Do any post build stuff ... such as sending emails depending on the
overall build result.
- post {
- // If this build failed, send an email to the list.
- failure {
- script {
- if(env.BRANCH_NAME == "unomi-1.4.x" || env.BRANCH_NAME ==
"unomi-1.5.x" || env.BRANCH_NAME == "master") {
- emailext(
- subject: "[BUILD-FAILURE]: Job '${env.JOB_NAME}
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
- body: """
-BUILD-FAILURE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}]
[${env.BUILD_NUMBER}]':
-Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME}
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]</a>"
-""",
- to: "[email protected]",
- recipientProviders: [[$class:
'DevelopersRecipientProvider']]
- )
- }
- }
- }
-
- // If this build didn't fail, but there were failing tests, send an
email to the list.
- unstable {
- script {
- if(env.BRANCH_NAME == "unomi-1.4.x" || env.BRANCH_NAME ==
"unomi-1.5.x" || env.BRANCH_NAME == "master") {
- emailext(
- subject: "[BUILD-UNSTABLE]: Job '${env.JOB_NAME}
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
- body: """
-BUILD-UNSTABLE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}]
[${env.BUILD_NUMBER}]':
-Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME}
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]</a>"
-""",
- to: "[email protected]",
- recipientProviders: [[$class:
'DevelopersRecipientProvider']]
- )
- }
- }
- }
-
- // Send an email, if the last build was not successful and this one is.
- success {
- // Cleanup the build directory if the build was successful
- // (in this cae we probably don't have to do any post-build
analysis)
- deleteDir()
- script {
- if ((env.BRANCH_NAME == "unomi-1.4.x" || env.BRANCH_NAME ==
"unomi-1.5.x" || env.BRANCH_NAME == "master") && (currentBuild.previousBuild !=
null) && (currentBuild.previousBuild.result != 'SUCCESS')) {
- emailext (
- subject: "[BUILD-STABLE]: Job '${env.JOB_NAME}
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
- body: """
-BUILD-STABLE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]':
-Is back to normal.
-""",
- to: "[email protected]",
- recipientProviders: [[$class:
'DevelopersRecipientProvider']]
- )
- }
- }
- }
- }
-
-}
diff --git a/Jenkinsfile-jdk11 b/Jenkinsfile-jdk11
deleted file mode 100644
index e9685ae..0000000
--- a/Jenkinsfile-jdk11
+++ /dev/null
@@ -1,157 +0,0 @@
-#!groovy
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-pipeline {
-
- agent {
- node {
- label 'ubuntu'
- }
- }
-
- environment {
- // ... setup any environment variables ...
- MVN_LOCAL_REPO_OPT = '-Dmaven.repo.local=.repository'
- MVN_TEST_FAIL_IGNORE = '-Dmaven.test.failure.ignore=true'
- }
-
- tools {
- // ... tell Jenkins what java version, maven version or other tools
are required ...
- maven 'maven_3_latest'
- jdk 'jdk_11_latest'
- }
-
- options {
- // Configure an overall timeout for the build of one hour.
- timeout(time: 1, unit: 'HOURS')
- // When we have test-fails e.g. we don't need to run the remaining
steps
- skipStagesAfterUnstable()
- buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr:
'5'))
- }
-
- stages {
- stage('Initialization') {
- steps {
- echo 'Building Branch: ' + env.BRANCH_NAME
- echo 'Using PATH = ' + env.PATH
- }
- }
-
- stage('Cleanup') {
- steps {
- echo 'Cleaning up the workspace'
- deleteDir()
- }
- }
-
- stage('Checkout') {
- steps {
- echo 'Checking out branch ' + env.BRANCH_NAME
- checkout scm
- }
- }
-
- stage('Build') {
- steps {
- echo 'Building'
- sh 'mvn -U -B -e clean install -DskipTests'
- }
- }
-
- stage('Tests') {
- steps {
- echo 'Running tests'
- sh 'mvn test'
- }
- post {
- always {
- junit(testResults: '**/surefire-reports/*.xml',
allowEmptyResults: true)
- junit(testResults: '**/failsafe-reports/*.xml',
allowEmptyResults: true)
- }
- }
- }
-
- stage('Integration tests') {
- steps {
- echo 'Running integration tests'
- sh 'mvn -pl itests clean install -Pintegration-tests'
- }
- }
- }
-
- // Do any post build stuff ... such as sending emails depending on the
overall build result.
- post {
- // If this build failed, send an email to the list.
- failure {
- script {
- if(env.BRANCH_NAME == "unomi-1.4.x" || env.BRANCH_NAME ==
"unomi-1.5.x" || env.BRANCH_NAME == "master") {
- emailext(
- subject: "[BUILD-FAILURE]: Job '${env.JOB_NAME}
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
- body: """
-BUILD-FAILURE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}]
[${env.BUILD_NUMBER}]':
-Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME}
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]</a>"
-""",
- to: "[email protected]",
- recipientProviders: [[$class:
'DevelopersRecipientProvider']]
- )
- }
- }
- }
-
- // If this build didn't fail, but there were failing tests, send an
email to the list.
- unstable {
- script {
- if(env.BRANCH_NAME == "unomi-1.4.x" || env.BRANCH_NAME ==
"unomi-1.5.x" || env.BRANCH_NAME == "master") {
- emailext(
- subject: "[BUILD-UNSTABLE]: Job '${env.JOB_NAME}
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
- body: """
-BUILD-UNSTABLE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}]
[${env.BUILD_NUMBER}]':
-Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME}
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]</a>"
-""",
- to: "[email protected]",
- recipientProviders: [[$class:
'DevelopersRecipientProvider']]
- )
- }
- }
- }
-
- // Send an email, if the last build was not successful and this one is.
- success {
- // Cleanup the build directory if the build was successful
- // (in this cae we probably don't have to do any post-build
analysis)
- deleteDir()
- script {
- if ((env.BRANCH_NAME == "unomi-1.4.x" || env.BRANCH_NAME ==
"unomi-1.5.x" || env.BRANCH_NAME == "master") && (currentBuild.previousBuild !=
null) && (currentBuild.previousBuild.result != 'SUCCESS')) {
- emailext (
- subject: "[BUILD-STABLE]: Job '${env.JOB_NAME}
[${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
- body: """
-BUILD-STABLE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]':
-Is back to normal.
-""",
- to: "[email protected]",
- recipientProviders: [[$class:
'DevelopersRecipientProvider']]
- )
- }
- }
- }
- }
-
-}
diff --git
a/itests/src/test/java/org/apache/unomi/itests/graphql/GraphQLListIT.java
b/itests/src/test/java/org/apache/unomi/itests/graphql/GraphQLListIT.java
index 6f18146..bfde614 100644
--- a/itests/src/test/java/org/apache/unomi/itests/graphql/GraphQLListIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/graphql/GraphQLListIT.java
@@ -108,6 +108,7 @@ public class GraphQLListIT extends BaseGraphQLIT {
profile.setProperty("firstName", "TestFirstName");
profile.setProperty("lastName", "TestLastName");
profileService.save(profile);
+ refreshPersistence();
keepTrying("Failed waiting for the creation of the profile",
() -> profileService.load(profile.getItemId()),
Objects::nonNull, 1000, 100);
@@ -139,7 +140,7 @@ public class GraphQLListIT extends BaseGraphQLIT {
}
}
- private UserList createList(final String id, final String name, final
String scope) {
+ private UserList createList(final String id, final String name, final
String scope) throws InterruptedException {
final Metadata metadata = new Metadata();
metadata.setId(id);
@@ -152,6 +153,7 @@ public class GraphQLListIT extends BaseGraphQLIT {
userList.setMetadata(metadata);
userListService.save(userList);
+ refreshPersistence();
return userList;
}