-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
abris #339 split code coverage and test GitHub actions
- Loading branch information
Showing
4 changed files
with
66 additions
and
86 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: CI check JaCoCo code-coverage | ||
|
||
on: | ||
pull_request: | ||
branches: [ master ] | ||
types: [ opened, edited, synchronize, reopened ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Setup Scala | ||
uses: olafurpg/setup-scala@v10 | ||
with: | ||
java-version: "[email protected]" | ||
- name: Build and run tests | ||
run: mvn clean verify -Pcode-coverage | ||
- name: Add coverage to PR | ||
id: jacoco | ||
uses: madrapps/[email protected] | ||
with: | ||
paths: ${{ github.workspace }}/target/site/jacoco/jacoco.xml | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
min-coverage-overall: 0.0 | ||
min-coverage-changed-files: 80.0 | ||
title: JaCoCo code coverage report | ||
update-comment: true | ||
- name: Get the Coverage info | ||
run: | | ||
echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}" | ||
echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}" | ||
- name: Fail PR if changed files coverage is less than 80% | ||
if: ${{ steps.jacoco.outputs.coverage-changed-files < 80.0 }} | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
core.setFailed('Changed files coverage is less than 80%!') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Test and verify | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
spark: [ 3.2 ] | ||
scala: [ 2.12, 2.13 ] | ||
|
||
name: (Spark ${{ matrix.spark }}, Scala ${{ matrix.scala }}) | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Run tests | ||
run: mvn clean verify -Plicense-check,spark-${{ matrix.spark }},scala-${{ matrix.scala }} |