Skip to content

Commit

Permalink
👷 [#14] Fix tests and added build_and_test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Bugrimov committed Aug 1, 2023
1 parent 0ebbd94 commit 5a8cf11
Showing 1 changed file with 7 additions and 33 deletions.
40 changes: 7 additions & 33 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5a8cf11

Please sign in to comment.