Create CODEOWNERS file #805
Workflow file for this run
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: Analyze, Build and Deploy | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
env: | |
JDK_VERSION: 17 | |
jobs: | |
safety-check: | |
name: Check for modified Gradle | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Validate Gradle artifacts | |
uses: gradle/wrapper-validation-action@v3 | |
detekt: | |
name: Generate Detekt report | |
needs: safety-check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Required for version number generation | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: ${{ env.JDK_VERSION }} | |
- name: Run Detekt | |
uses: gradle/[email protected] | |
with: | |
arguments: detekt | |
- name: Collect results | |
shell: sh | |
run: > | |
mkdir sarif && | |
find * -name detekt.sarif -print0 | | |
xargs -n1 -0 bash -c 'cp "$1" "sarif/${1//\//-}"' '{}' | |
- name: Upload analysis results | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: sarif | |
wait-for-processing: true | |
unit-test: | |
name: Run unit tests | |
needs: safety-check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Required for version number generation | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: ${{ env.JDK_VERSION }} | |
- name: Run tests | |
uses: gradle/[email protected] | |
with: | |
arguments: test | |
- name: Upload test results | |
uses: mikepenz/action-junit-report@v4 | |
if: always() # Must execute after failed tests | |
with: | |
report_paths: '**/build/test-results/test/TEST-*.xml' | |
platform-test: | |
name: Run JUnit tests on ${{ matrix.os }} | |
needs: unit-test | |
strategy: | |
matrix: | |
os: [ macos-latest, windows-latest ] # Ubuntu is tested in "test" job | |
fail-fast: false # Ensure we get all failures on other platforms | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Required for version number generation | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: ${{ env.JDK_VERSION }} | |
- name: Run tests | |
uses: gradle/[email protected] | |
with: | |
arguments: test | |
spotless: | |
name: Run Spotless | |
needs: safety-check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Initial Setup | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Required for version number generation & diff generation | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: ${{ env.JDK_VERSION }} | |
- name: Run Spotless checks | |
id: spotlessCheck | |
uses: gradle/[email protected] | |
with: | |
arguments: spotlessCheck | |
- name: Apply Spotless fixes | |
if: failure() | |
uses: gradle/[email protected] | |
with: | |
arguments: spotlessApply | |
- name: Generate diff | |
if: failure() | |
shell: sh | |
run: | | |
echo "# Spotless violations" >> $GITHUB_STEP_SUMMARY | |
echo "```diff" >> $GITHUB_STEP_SUMMARY | |
git diff >> $GITHUB_STEP_SUMMARY | |
echo "```" >> $GITHUB_STEP_SUMMARY |