Skip to content

Commit

Permalink
[CI] - Spotless GitHub actions (#544)
Browse files Browse the repository at this point in the history
* Add spotless github action, and gradle daemon false
* Remove spotless commandLine execution in: buildAndTestMultip & buildAndTestSinglep
---------
Co-authored-by: tomascayuelas <[email protected]>
  • Loading branch information
tomascayuelas authored Nov 21, 2023
1 parent 6aff24b commit 4ec42c2
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 7 deletions.
43 changes: 40 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Build

on:
pull_request:
pull_request: {}
workflow_dispatch: {}

env:
GRADLE_OPTS: -Dorg.gradle.daemon=false

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -27,11 +31,12 @@ jobs:
os: windows-latest

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Java
- name: Configure JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
Expand All @@ -54,3 +59,35 @@ jobs:
with:
name: 'reports'
path: '**/build/reports/**'

spotless:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Configure JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 20

- name: Spotless Apply
uses: gradle/gradle-build-action@v2
with:
arguments: spotlessApply

- name: Commit newly formatted files
uses: stefanzweifel/git-auto-commit-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commit_message: "Apply spotless formatting"
commit_options: '--no-verify'
file_pattern: '**/*.kt'
commit_user_name: "GitHub Actions"
4 changes: 0 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ fun Project.configureBuildAndTestTask(taskName: String, moduleType: ModulePlatfo
tasks.register(taskName) {
val gradleCommand = getGradleCommand(platform)

doFirst {
project.exec {commandLine(gradleCommand, "spotlessCheck") }
}

doLast {
when (moduleType) {
ModulePlatformType.SINGLE -> {
Expand Down

0 comments on commit 4ec42c2

Please sign in to comment.