Skip to content

CI - Pull Request Validation #295

CI - Pull Request Validation

CI - Pull Request Validation #295

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@v4
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@v4
with:
commit: ${{github.event.workflow_run.head_sha}}
report_paths: '**/build/test-results/test/TEST-*.xml'