From 2d3d7bedbb4ba7805f98f009b75fe43568739412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85smund=20V=C3=A5ge=20Fannemel?= <34712686+asmfstatoil@users.noreply.github.com> Date: Mon, 31 Jul 2023 13:50:39 +0200 Subject: [PATCH] CI: merge code coverage with asserting builds (#792) * Update verify_build.yml Add code coverage publishing * Delete test_coverage.yml --- .github/workflows/test_coverage.yml | 29 ----------------------------- .github/workflows/verify_build.yml | 14 ++++++++++---- 2 files changed, 10 insertions(+), 33 deletions(-) delete mode 100644 .github/workflows/test_coverage.yml diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml deleted file mode 100644 index 13ed1c406..000000000 --- a/.github/workflows/test_coverage.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Test coverage report -on: - workflow_dispatch: - push: - branches: - - release/* - -jobs: - unit-tests: - name: Unit Tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - - name: Run tests and create jacoco.exec - run: mvn -B test -ntp - - name: Create coverage report from jacoco execution data - run: mvn -B jacoco:report -ntp - - name: Upload jacoco coverage reports to Codecov - uses: codecov/codecov-action@v3 - with: - file: jacoco.xml - name: codecov - token: ${{ secrets.CODECOV_TOKEN }} - - diff --git a/.github/workflows/verify_build.yml b/.github/workflows/verify_build.yml index 7da5cdd07..d3cd2dc7a 100644 --- a/.github/workflows/verify_build.yml +++ b/.github/workflows/verify_build.yml @@ -6,8 +6,6 @@ on: branches: # Only run for changes in master branch and any releases branch - master - 'releases/**' - # paths: # Only run if some java-file is updated - # - '*.java' pull_request: branches: - master @@ -27,7 +25,15 @@ jobs: - name: Generate javadoc run: mvn javadoc:javadoc - name: Run tests - run: mvn -B test --file pom.xml + run: mvn -B test --file pom.xml -ntp + - name: Create coverage report from jacoco execution data + run: mvn -B jacoco:report -ntp + - name: Upload jacoco coverage reports to Codecov + uses: codecov/codecov-action@v3 + with: + file: jacoco.xml + name: codecov + token: ${{ secrets.CODECOV_TOKEN }} test_java_8: name: Assert tests and javadoc with java 8 @@ -43,5 +49,5 @@ jobs: java-version: '8' cache: 'maven' - name: Run tests - run: mvn -B test --file pomJava8.xml + run: mvn -B test --file pomJava8.xml -ntp