From e828ed176cfe9f5d7a1ad4b9ed7cf162d336ca3c Mon Sep 17 00:00:00 2001 From: David Greven Date: Fri, 15 Oct 2021 13:25:56 +0200 Subject: [PATCH] Add build and test workflow (#22) * Add build and test workflow * Adjust source and target levels * Enable jacoco coverage profile * Update jacoco plugin version See jacoco/jacoco#1132 for JDK 17 support. Signed-off-by: David Greven --- .github/workflows/build-and-test.yaml | 41 +++++++++++++++++++++++++++ pom.xml | 34 ++++++++++++++++++++-- 2 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build-and-test.yaml diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml new file mode 100644 index 0000000..586873f --- /dev/null +++ b/.github/workflows/build-and-test.yaml @@ -0,0 +1,41 @@ +# +# Copyright (c) 2021 - for information on the respective copyright owner +# see the NOTICE file and/or the repository https://github.com/carbynestack/cli-ng. +# +# SPDX-License-Identifier: Apache-2.0 +# +name: Build and test artifacts +on: push +jobs: + test: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' + - name: Setting up Github Package Repository as Maven Repository + uses: s4u/maven-settings-action@v2 + with: + githubServer: false + servers: | + [{ + "id": "github", + "username": "${{ secrets.GHPR_USERNAME }}", + "password": "${{ secrets.GHPR_TOKEN }}" + }] + - name: Build with Maven + run: mvn install -Dskip.tests --batch-mode --update-snapshots --no-transfer-progress + - name: Run Tests + run: mvn verify --activate-profiles coverage --batch-mode --no-transfer-progress + - name: Collect Jacoco reports + run: echo ::set-output name=reports::$(find . -regex '.*/target/site/jacoco/jacoco.xml' | tr '\n' ',' | sed 's/.$//') + id: jacoco + - uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ${{ steps.jacoco.outputs.reports }} + name: codecov \ No newline at end of file diff --git a/pom.xml b/pom.xml index 7268f94..f082ea4 100644 --- a/pom.xml +++ b/pom.xml @@ -39,13 +39,13 @@ UTF-8 UTF-8 - 16 - 16 + 17 + 17 3.3.0 3.8.1 - 0.8.6 + 0.8.7 3.2.0 3.2.1 3.0.0-M5 @@ -249,4 +249,32 @@ + + + coverage + + + + org.jacoco + jacoco-maven-plugin + ${maven-jacoco-plugin.version} + + + + prepare-agent + + + + generate-report + + report + + + + + + + + + \ No newline at end of file