From 7b82f875d1f02d0fe660ec368d736efc22d47c48 Mon Sep 17 00:00:00 2001 From: Henrique Date: Mon, 20 Apr 2020 14:23:03 +0200 Subject: [PATCH 1/5] add release workflow --- .github/workflows/mavenpublish.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/mavenpublish.yml diff --git a/.github/workflows/mavenpublish.yml b/.github/workflows/mavenpublish.yml new file mode 100644 index 00000000..05177993 --- /dev/null +++ b/.github/workflows/mavenpublish.yml @@ -0,0 +1,30 @@ +# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path + +name: Maven Package + +on: + release: + types: [created] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.11 + uses: actions/setup-java@v1 + with: + java-version: 1.11 + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Build with Maven + run: mvn -B package --file pom.xml + + - name: Publish to GitHub Packages Apache Maven + run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml + env: + GITHUB_TOKEN: ${{ github.token }} From 5f5df8c54d329d97aa954c1d4cd48afb1641a3d6 Mon Sep 17 00:00:00 2001 From: Henrique Truta Date: Mon, 20 Apr 2020 14:29:39 +0200 Subject: [PATCH 2/5] Setup release and PR flows --- .github/workflows/maven_pr.yml | 22 +++++++++++++++++++ .../{mavenpublish.yml => maven_release.yml} | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/maven_pr.yml rename .github/workflows/{mavenpublish.yml => maven_release.yml} (95%) diff --git a/.github/workflows/maven_pr.yml b/.github/workflows/maven_pr.yml new file mode 100644 index 00000000..322932d9 --- /dev/null +++ b/.github/workflows/maven_pr.yml @@ -0,0 +1,22 @@ +# 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: Java CI with Maven + +on: + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.11 + uses: actions/setup-java@v1 + with: + java-version: 1.11 + - name: Build with Maven + run: mvn -B package --file pom.xml diff --git a/.github/workflows/mavenpublish.yml b/.github/workflows/maven_release.yml similarity index 95% rename from .github/workflows/mavenpublish.yml rename to .github/workflows/maven_release.yml index 05177993..7364fa79 100644 --- a/.github/workflows/mavenpublish.yml +++ b/.github/workflows/maven_release.yml @@ -27,4 +27,4 @@ jobs: - name: Publish to GitHub Packages Apache Maven run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml env: - GITHUB_TOKEN: ${{ github.token }} + GITHUB_TOKEN: ${{ github.token }} \ No newline at end of file From aabc453544a5b876e734ca392b6570695fa35390 Mon Sep 17 00:00:00 2001 From: Henrique Truta Date: Mon, 20 Apr 2020 14:55:53 +0200 Subject: [PATCH 3/5] Add codecov step --- .../{maven_release.yml => maven.yml} | 22 ++++++++++++------- .github/workflows/maven_pr.yml | 22 ------------------- .gitignore | 4 ++++ 3 files changed, 18 insertions(+), 30 deletions(-) rename .github/workflows/{maven_release.yml => maven.yml} (57%) delete mode 100644 .github/workflows/maven_pr.yml diff --git a/.github/workflows/maven_release.yml b/.github/workflows/maven.yml similarity index 57% rename from .github/workflows/maven_release.yml rename to .github/workflows/maven.yml index 7364fa79..a86bd913 100644 --- a/.github/workflows/maven_release.yml +++ b/.github/workflows/maven.yml @@ -1,11 +1,17 @@ # This workflow will build a package using Maven and then publish it to GitHub packages when a release is created # For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path -name: Maven Package +name: Java Maven on: - release: - types: [created] + push: + branches: + - master + - 'releases/*' + - 'refs/tags/*' + pull_request: + branches: + - master jobs: build: @@ -22,9 +28,9 @@ jobs: settings-path: ${{ github.workspace }} # location for the settings.xml file - name: Build with Maven - run: mvn -B package --file pom.xml - - - name: Publish to GitHub Packages Apache Maven - run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml env: - GITHUB_TOKEN: ${{ github.token }} \ No newline at end of file + CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} + run: | + mvn clean verify -Pcoverage -Ppack --file pom.xml --batch-mode -Dsytle.colors=always --errors + bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN -F unittests -f ./github-client/target/site/jacoco/jacoco.xml -n codecov-umbrella + diff --git a/.github/workflows/maven_pr.yml b/.github/workflows/maven_pr.yml deleted file mode 100644 index 322932d9..00000000 --- a/.github/workflows/maven_pr.yml +++ /dev/null @@ -1,22 +0,0 @@ -# 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: Java CI with Maven - -on: - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.11 - uses: actions/setup-java@v1 - with: - java-version: 1.11 - - name: Build with Maven - run: mvn -B package --file pom.xml diff --git a/.gitignore b/.gitignore index b12dd7c8..b199a8ee 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,7 @@ target .#* dependency-reduced-pom.xml +.factorypath +.classpath +.project +.settings/ From 9e6d10a70df19723938f09a558eabba0687064b0 Mon Sep 17 00:00:00 2001 From: Henrique Truta Date: Mon, 20 Apr 2020 15:05:53 +0200 Subject: [PATCH 4/5] Add coverage profile and fix path --- .github/workflows/maven.yml | 2 +- pom.xml | 73 ++++++++++++++++++++++++++++++------- 2 files changed, 60 insertions(+), 15 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index a86bd913..426c5679 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -32,5 +32,5 @@ jobs: CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} run: | mvn clean verify -Pcoverage -Ppack --file pom.xml --batch-mode -Dsytle.colors=always --errors - bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN -F unittests -f ./github-client/target/site/jacoco/jacoco.xml -n codecov-umbrella + bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN -F unittests -f ./target/site/jacoco/jacoco.xml -n codecov-umbrella diff --git a/pom.xml b/pom.xml index 968786f7..114bd36d 100644 --- a/pom.xml +++ b/pom.xml @@ -246,6 +246,65 @@ + + + coverage + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + + + **/*Builder* + **/*Immutable* + **/*_Factory* + **/*_*Factory*.* + **/generated-sources*.* + + + + BUNDLE + + + INSTRUCTION + COVEREDRATIO + 0.60 + + + + + + + + pre-test + + prepare-agent + + + + default-check + + check + + + + post-unit-test + test + + report + + + + + + + + + @@ -333,20 +392,6 @@ 4.0.0 spotbugs-maven-plugin - - org.jacoco - jacoco-maven-plugin - 0.8.5 - - - **/*Builder* - **/*Immutable* - **/*_Factory* - **/*_*Factory*.* - **/generated-sources*.* - - - com.coveo fmt-maven-plugin From 6215b16b33717d136ac54bbf7cbc6d139144c4ec Mon Sep 17 00:00:00 2001 From: Henrique Truta Date: Mon, 20 Apr 2020 15:09:43 +0200 Subject: [PATCH 5/5] Rename workflow --- .github/workflows/maven.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 426c5679..91bc2721 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,7 +1,7 @@ # This workflow will build a package using Maven and then publish it to GitHub packages when a release is created # For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path -name: Java Maven +name: maven on: push: @@ -33,4 +33,3 @@ jobs: run: | mvn clean verify -Pcoverage -Ppack --file pom.xml --batch-mode -Dsytle.colors=always --errors bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN -F unittests -f ./target/site/jacoco/jacoco.xml -n codecov-umbrella -