forked from checkstyle/checkstyle
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.29 KB
/
google-java-format.yml
File metadata and controls
49 lines (42 loc) · 1.29 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
#####################################################################################
# GitHub Action to format specific files by google-java-format.
#
# Workflow starts when:
# 1) push to master
# 2) PR created or pushed
#
#####################################################################################
name: Google-Java-Format
on:
push:
branches:
- master
pull_request:
branches: '*'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
VERSION: 1.26.0
jobs:
test:
if: github.repository == 'checkstyle/checkstyle'
runs-on: ubuntu-latest
steps:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Checkout Pull Request Code
uses: actions/checkout@v4
- uses: robinraju/release-downloader@v1
with:
repository: 'google/google-java-format'
tag: "v${{env.VERSION}}"
fileName: "google-java-format-${{env.VERSION}}-all-deps.jar"
out-file-path: '.ci-temp'
- name: Run Formatting
run: |
./.ci/google-java-format.sh .ci-temp/google-java-format-${{env.VERSION}}-all-deps.jar
./.ci/validation.sh git-diff