Add Gradle Build Action #284
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: CI - Pull Request Validation | |
on: | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
branches: | |
- main | |
- release/* | |
- feature/* | |
- bugfix/* | |
workflow_dispatch: | |
jobs: | |
pull-request-validation: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: validation-${{ github.head_ref }} | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.head_ref }} | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 11 | |
- name: Setup Android SDK | |
uses: bitfunk/[email protected] | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Build | |
run: ./gradlew --no-daemon --stacktrace build | |
- name: Upload Test Report | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: junit-test-results | |
path: '**/build/test-results/test/TEST-*.xml' | |
retention-days: 1 | |
- name: Analyze | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: ./gradlew --no-daemon --stacktrace testCodeCoverageReport sonar | |
- name: Publish Development Version | |
run: echo "TODO" | |
pull-request-validation-test-report: | |
name: "Publish Test Report" | |
runs-on: ubuntu-latest | |
needs: pull-request-validation | |
permissions: | |
checks: write | |
if: always() | |
steps: | |
- name: Download Test Report | |
uses: actions/download-artifact@v3 | |
with: | |
name: junit-test-results | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v3 | |
with: | |
commit: ${{github.event.workflow_run.head_sha}} | |
report_paths: '**/build/test-results/test/TEST-*.xml' |