Repository navigation
52 lines (43 loc) · 1.45 KB
/
Copy pathspotless.yml
File metadata and controls
52 lines (43 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Spotless
on:
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
defaults:
run:
shell: bash
permissions:
contents: read
jobs:
spotless-check:
runs-on: ubuntu-latest
name: spotless-check
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Reclaim disk space
working-directory: .github/scripts
shell: bash
run: ./ci-reclaim-disk-space.sh
- name: Set up Java 17
uses: actions/setup-java@77dd5b2ce225ea11469928ac317850245a74ae78 # v6.2.0
with:
java-version: 17
distribution: temurin
- name: Setup Gradle
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
- name: Run Spotless check
run: |
if ! ./gradlew --no-daemon -Pjava.version=17 spotlessCheck; then
echo "::error title=Spotless check failed::Formatting violations were found."
echo "Fix options:"
echo " 1) Run: ./gradlew --no-daemon spotlessApply"
echo " 2) Ensure your IDE honors .editorconfig and reformat changed files"
echo "Then commit and push the updated files."
exit 1
fi