Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests in PR to have some infos #297

Merged
merged 11 commits into from
Dec 7, 2022
33 changes: 33 additions & 0 deletions .github/workflows/on_pull_request_push_run_test_and_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: On pull request push, perform a build with test reports shown and coverage evaluated (and compared with master)
on:
pull_request:
branches-ignore: [ master ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 11
cache: 'maven'
- name: Build with Maven
run: mvn -B test --file pom.xml -Pcoverage
env:
TOKEN_FOR_GITHUB: ${{ secrets.TOKEN_FOR_GITHUB }}
- name: Add coverage to PR
id: jacoco
uses: madrapps/jacoco-report@v1.3
with:
paths: |
${{ github.workspace }}/base/target/site/jacoco/jacoco.xml,
${{ github.workspace }}/architecture-documentation/target/site/jacoco/jacoco.xml,
${{ github.workspace }}/markdown-to-asciidoc/target/site/jacoco/jacoco.xml,
${{ github.workspace }}/maven-metadata-inferer/target/site/jacoco/jacoco.xml,
${{ github.workspace }}/sequence-diagram-generator/target/site/jacoco/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 10
min-coverage-changed-files: 50
2 changes: 0 additions & 2 deletions .github/workflows/on_push_on_master_deploy_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ name: On master push perform build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
Expand Down
27 changes: 27 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,33 @@
</plugins>
</build>
<profiles>
<profile>
<id>coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<executions>
<execution>
<id>Jacoco - prepare agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>Jacoco - generate report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>release</id>
<build>
Expand Down