Fix/build issues #201
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
name: build | |
on: | |
pull_request_target: | |
push: | |
branches: master | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Debug - Print Last Commit | |
run: git log -1 | |
- name: Debug - Check File Changes | |
run: git diff --name-only HEAD~1 HEAD | |
- name: Setup Java | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
java-package: jdk | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Clear Gradle Cache | |
run: ./gradlew clean | |
- name: Run Check | |
run: ./gradlew check | |
- name: Run Jacoco | |
run: ./gradlew jacocoTestReport | |
- name: Upload Report | |
uses: 'actions/upload-artifact@v4' | |
with: | |
name: report.xml | |
path: ${{ github.workspace }}/ipv8/build/reports/jacoco/test/jacocoTestReport.xml | |
- name: Add coverage to PR | |
id: jacoco | |
uses: madrapps/[email protected] | |
with: | |
paths: ${{ github.workspace }}/ipv8/build/reports/jacoco/test/jacocoTestReport.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
min-coverage-overall: 60 | |
min-coverage-changed-files: 80 | |
- 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: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |