Skip to content
Merged
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
69 changes: 69 additions & 0 deletions .github/workflows/maven-java-feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Maven CI for Java for Feature/Bugfix Branch

on:
push:
branches-ignore:
- 'develop'
- 'release/*'
- 'master'
- 'hotfix/*'
- 'support/*'

jobs:
maven-build-test-verify:
name: Maven test, package and deploy Java project
runs-on: ubuntu-latest
steps:
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Maven version
run: mvn -version
env:
SERVER_USERNAME: $GITHUB_ACTOR
SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}}
- name: Check out from version control
uses: actions/checkout@v2
- name: Cache Maven dependencies
uses: actions/cache@v1
env:
cache-name: cache-maven-dependencies
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-${{ env.cache-name }}-
${{ runner.os }}-m2-
${{ runner.os }}-
- name: Get Maven Project information
id: maven-project-info
run: |
echo "$(mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)"
echo "$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)"
echo "$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)"
echo "$(mvn help:evaluate -Dexpression=project.packaging -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)"
env:
SERVER_USERNAME: $GITHUB_ACTOR
SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}}
- name: Build with Maven
run: mvn -U clean compile -Pproject-controls-check --file pom.xml --settings .github/workflows/settings.xml
env:
SERVER_USERNAME: $GITHUB_ACTOR
SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}}
- name: Unit Test with Maven
run: mvn -U -Dmaven.main.skip test --file pom.xml --settings .github/workflows/settings.xml
env:
SERVER_USERNAME: $GITHUB_ACTOR
SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}}
- name: Verify with Maven
run: mvn -U -Dmaven.main.skip -Dunit.test.skip verify --file pom.xml --settings .github/workflows/settings.xml
env:
SERVER_USERNAME: $GITHUB_ACTOR
SERVER_PASSWORD: ${{ secrets.MVN_PCKGS_REPO_TOKEN}}
#TODO - name: Set Leak Period [SonarQube]
#TODO run: checkout du parent commun
#TODO run: mvn -U clean verify '-Dmaven.test.failure.ignore=true'
#TODO run: mvn -U '-Dsonar.links.scm=http://gitxxx' '-Dsonar.links.ci=http://jenkinsxxx' org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar '-Dsonar.projectKey=[groupId]-[artifactId]' '-Dsonar.branch.name=develop' '-Dsonar.projectName=[artifactId]r' '-Dsonar.buildbreaker.skip=true' '-Dsonar.projectVersion=#d0b75832'
#TODO - name: Quality Gate [SonarQube]
#TODO run: mvn -U '-Dsonar.links.scm=http://gitxxx' '-Dsonar.links.ci=http://jenkinsxxx' org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar '-Dsonar.projectKey=[groupId]-[artifactId]' '-Dsonar.branch.name=develop' '-Dsonar.projectName=[artifactId]' '-Dsonar.gitlab.ref_name=b7c32ea3401d64f97eecc4dd46de331b00391cd7' '-Dsonar.gitlab.commit_sha=b7c32ea3401d64f97eecc4dd46de331b00391cd7' '-Dsonar.gitlab.project_id=3555'
6 changes: 5 additions & 1 deletion .github/workflows/maven-java.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Maven CI for Java

on: [push]
on:
push:
branches-ignore:
- 'feature/*'
- 'bugfix/*'

jobs:
gihub-context-get-info:
Expand Down
34 changes: 28 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,31 @@ cache:
- $HOME/.m2
install: true

script:
- mvn -U clean compile -Pproject-controls-check --file pom.xml --settings .github/workflows/settings.xml
- mvn -U -Dmaven.main.skip test --file pom.xml --settings .github/workflows/settings.xml
- mvn -U -Dmaven.main.skip -Dunit.test.skip verify --file pom.xml --settings .github/workflows/settings.xml
- mvn -U -Dmaven.main.skip -Dunit.test.skip -Dverify.skip jar:jar@default-jar assembly:single@make-assembly source:jar-no-fork@attach-sources javadoc:jar@attach-javadocs deploy --file pom.xml --settings .github/workflows/settings.xml
- mvn -U site --file pom.xml --settings .github/workflows/settings.xml
jobs:
include:
- stage: Get Maven Project information
script:
- echo $(mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)
- echo $(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)
- echo $(mvn help:evaluate -Dexpression=project.version -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)
- echo $(mvn help:evaluate -Dexpression=project.packaging -q -DforceStdout --file pom.xml --settings .github/workflows/settings.xml)

- stage: Build, Test and Verify with Maven
script:
- mvn -U clean compile -Pproject-controls-check --file pom.xml --settings .github/workflows/settings.xml
- mvn -U -Dmaven.main.skip test --file pom.xml --settings .github/workflows/settings.xml
- mvn -U -Dmaven.main.skip -Dunit.test.skip verify --file pom.xml --settings .github/workflows/settings.xml

- stage: Publish to GitHub Packages Apache Maven
script:
- mvn -U -Dmaven.main.skip -Dunit.test.skip -Dverify.skip jar:jar@default-jar assembly:single@make-assembly source:jar-no-fork@attach-sources javadoc:jar@attach-javadocs deploy --file pom.xml --settings .github/workflows/settings.xml

- stage: Site with Maven
script:
- mvn -U site --file pom.xml --settings .github/workflows/settings.xml

stages:
- name: Publish to GitHub Packages Apache Maven
if: type = push AND branch =~ /^((develop|master)|((release|hotfix|support)\/(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?))$/
- name: Site with Maven
if: type = push AND branch =~ /^((develop|master)|((release|hotfix|support)\/(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?))$/