mirror of https://github.com/apache/maven.git
create a simple Jenkinsfile/gh actions to validate PR and branches without changes in core (#172)
* create a simple Jenkinsfile and GHA to validate PR and branches Signed-off-by: Olivier Lamy <olamy@apache.org>
This commit is contained in:
parent
ae3adfed57
commit
e47b17772b
|
@ -0,0 +1,48 @@
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
name: Java CI
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest]
|
||||||
|
java: [8, 17]
|
||||||
|
fail-fast: false
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up JDK
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
java-version: ${{ matrix.java }}
|
||||||
|
distribution: 'temurin'
|
||||||
|
cache: 'maven'
|
||||||
|
|
||||||
|
- name: Set up Maven
|
||||||
|
run: mvn --errors --batch-mode --show-version wrapper:wrapper "-Dmaven=3.8.6"
|
||||||
|
|
||||||
|
- name: Running integration tests
|
||||||
|
# execute on any push or pull request from forked repo
|
||||||
|
if: github.event_name == 'push' || ( github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork )
|
||||||
|
run: "./mvnw -B clean install -Prun-its,embedded -Dmaven.repo.local=`pwd`/repo"
|
|
@ -0,0 +1,64 @@
|
||||||
|
#!groovy
|
||||||
|
|
||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
// save some io during the build
|
||||||
|
options { durabilityHint('PERFORMANCE_OPTIMIZED') }
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage("Parallel Stage") {
|
||||||
|
parallel {
|
||||||
|
stage("Build / Test - mvn latest - JDK8 - ubuntu") {
|
||||||
|
agent { node { label 'ubuntu' } }
|
||||||
|
steps {
|
||||||
|
timeout( time: 180, unit: 'MINUTES' ) {
|
||||||
|
mavenBuild( "jdk_1.8_latest", "maven_latest")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage("Build / Test - mvn latest - JDK11 - ubuntu") {
|
||||||
|
agent { node { label 'ubuntu' } }
|
||||||
|
steps {
|
||||||
|
timeout( time: 180, unit: 'MINUTES' ) {
|
||||||
|
mavenBuild( "jdk_11_latest", "maven_latest")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage("Build / Test - mvn latest - JDK8 - windowx") {
|
||||||
|
agent { node { label 'Windows' } }
|
||||||
|
steps {
|
||||||
|
timeout( time: 180, unit: 'MINUTES' ) {
|
||||||
|
mavenBuild( "jdk_1.8_latest", "maven_latest")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage("Build / Test - mvn latest - JDK11 - windows") {
|
||||||
|
agent { node { label 'Windows' } }
|
||||||
|
steps {
|
||||||
|
timeout( time: 180, unit: 'MINUTES' ) {
|
||||||
|
mavenBuild( "jdk_11_latest", "maven_latest")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def mavenBuild(jdk, mvnName) {
|
||||||
|
script {
|
||||||
|
try {
|
||||||
|
withMaven(jdk: "$jdk", maven: "$mvnName", publisherStrategy: 'EXPLICIT', mavenOpts: "-Xms2g -Xmx4g -Djava.awt.headless=true") {
|
||||||
|
if (isUnix()) {
|
||||||
|
sh "mvn -V clean install -Prun-its,embedded -B"
|
||||||
|
} else {
|
||||||
|
bat "mvn -V clean install -Prun-its,embedded -B"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
junit testResults: 'core-it-suite/target/surefire-reports/*.xml', allowEmptyResults: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -72,7 +72,7 @@ under the License.
|
||||||
use for the tests. -->
|
use for the tests. -->
|
||||||
<preparedMavenHome>${mavenHome}</preparedMavenHome>
|
<preparedMavenHome>${mavenHome}</preparedMavenHome>
|
||||||
<!-- default properties used to filter the global settings -->
|
<!-- default properties used to filter the global settings -->
|
||||||
<maven.it.central>https://repo1.maven.org/maven2</maven.it.central>
|
<maven.it.central>https://repo.maven.apache.org/maven2</maven.it.central>
|
||||||
<proxy.active>false</proxy.active>
|
<proxy.active>false</proxy.active>
|
||||||
<proxy.host>localhost</proxy.host>
|
<proxy.host>localhost</proxy.host>
|
||||||
<proxy.port>80</proxy.port>
|
<proxy.port>80</proxy.port>
|
||||||
|
|
|
@ -47,6 +47,12 @@ under the License.
|
||||||
<version>${maven-version}</version>
|
<version>${maven-version}</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- this might help github actions to not fail... -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
|
<artifactId>plexus-classworlds</artifactId>
|
||||||
|
<version>2.5.2</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
Loading…
Reference in New Issue