Skip to content

Added spotless

Added spotless #152

Workflow file for this run

name: "Build"
# Controls when the action will run. Triggers the workflow on push or pull request
# events for the `master` branch
on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
schedule:
# Run once a week (even if no new code or PRs) to detect random regressions
- cron: "12 13 * * 2"
env:
# Allow precise monitoring of the save/restore of Gradle User Home by `gradle-build-action`
# See https://github.com/marketplace/actions/gradle-build-action?version=v2.1.1#cache-debugging-and-analysis
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: "openmrs-android" # change this to invalidate cache
concurrency:
# github.head_ref uniquely identifies Pull Requests (but is not available when building branches like main or master)
# github.ref is the fallback used when building for workflows triggered by push
# Note that || are fallback values (not "concatenations")
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true # Use e.g. ${{ github.ref != 'refs/heads/main' }} (or master, until #2180) to only cancel for PRs not on branch
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Build will compile APK, test APK and run tests, lint, etc.
build:
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
packages: write
strategy:
fail-fast: false
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repo
uses: actions/checkout@v4
with:
# Fetch origin/master for spotless ratchet to work
# https://github.com/diffplug/spotless/issues/1242
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
cache: 'gradle'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Change wrapper permissions
run: chmod +x ./gradlew
env:
USERNAME: $GITHUB_ACTOR
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Gradle tests
run: ./gradlew test --full-stacktrace
env:
USERNAME: $GITHUB_ACTOR
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build (full) with Gradle
run: ./gradlew build --full-stacktrace
env:
USERNAME: $GITHUB_ACTOR
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Maven packages to GitHub Packages
if: ${{ github.event_name == 'push' }}
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}