-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👷 [#14] Fix tests and added build_and_test.yml
- Loading branch information
Alex Bugrimov
committed
Aug 1, 2023
1 parent
0ebbd94
commit 5a8cf11
Showing
1 changed file
with
7 additions
and
33 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -10,39 +10,13 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up the Java JDK | ||
uses: actions/setup-java@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'adopt' | ||
|
||
- name: Build with Maven | ||
run: mvn -B test | ||
|
||
- name: Generate Jacoco Badge | ||
id: jacoco | ||
uses: cicirello/jacoco-badge-generator@v2 | ||
distribution: 'temurin' | ||
- run: mvn --batch-mode --update-snapshots verify | ||
- run: mkdir staging && cp target/*.jar staging | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
badges-directory: badges | ||
generate-branches-badge: true | ||
|
||
- name: Log coverage percentage | ||
run: | | ||
echo "coverage = ${{ steps.jacoco.outputs.coverage }}" | ||
echo "branches = ${{ steps.jacoco.outputs.branches }}" | ||
- name: Commit and push | ||
if: ${{ github.event_name != 'pull_request' }} | ||
run: | | ||
cd badges | ||
if [[ `git status --porcelain *.svg` ]]; then | ||
git config --global user.name 'github-actions' | ||
git config --global user.email '[email protected]' | ||
git add *.svg | ||
git commit -m "Autogenerated JaCoCo coverage badge" *.svg | ||
git push | ||
fi | ||
- name: Upload Jacoco coverage report | ||
uses: actions/upload-artifact@v3 | ||
name: Package | ||
path: staging |