mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
name: Reusable Lint and Format Check
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
ref:
|
|
description: 'The branch, tag or SHA to checkout'
|
|
required: false
|
|
type: string
|
|
secrets:
|
|
GRADLE_ENCRYPTION_KEY:
|
|
required: false
|
|
GRADLE_CACHE_URL:
|
|
required: false
|
|
GRADLE_CACHE_USERNAME:
|
|
required: false
|
|
GRADLE_CACHE_PASSWORD:
|
|
required: false
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest # Lint is fast, doesn't need large runner
|
|
timeout-minutes: 10
|
|
env:
|
|
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
|
|
GRADLE_CACHE_URL: ${{ secrets.GRADLE_CACHE_URL }}
|
|
GRADLE_CACHE_USERNAME: ${{ secrets.GRADLE_CACHE_USERNAME }}
|
|
GRADLE_CACHE_PASSWORD: ${{ secrets.GRADLE_CACHE_PASSWORD }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
ref: ${{ inputs.ref || '' }}
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'jetbrains'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v5
|
|
with:
|
|
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
|
build-scan-publish: true
|
|
build-scan-terms-of-use-url: 'https://gradle.com/terms-of-service'
|
|
build-scan-terms-of-use-agree: 'yes'
|
|
add-job-summary: always
|
|
|
|
- name: Run Spotless and Detekt
|
|
run: ./gradlew spotlessCheck detekt -Pci=true --scan
|