Repository navigation
81 lines (70 loc) · 2.38 KB
/
Copy pathgoogle-java-format.yml
File metadata and controls
81 lines (70 loc) · 2.38 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#####################################################################################
# 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:
types: [ opened, synchronize, reopened, closed ]
branches: '*'
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
env:
VERSION: 1.37.0
jobs:
test-java21:
if: github.event.action != 'closed' && github.repository == 'checkstyle/checkstyle'
runs-on: ubuntu-latest
steps:
- name: Set up JDK 21
uses: actions/setup-java@v6.1.0
with:
java-version: 21
distribution: 'temurin'
- name: Checkout Pull Request Code
uses: actions/checkout@v7
with:
persist-credentials: false
- uses: robinraju/release-downloader@28fc21f50d76778e7023361aa1f863e717d3d56f # 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 java21
./.ci/validation.sh git-diff
test-java25:
if: github.event.action != 'closed' && github.repository == 'checkstyle/checkstyle'
runs-on: ubuntu-latest
steps:
- name: Set up JDK 25
uses: actions/setup-java@v6.1.0
with:
java-version: 25
distribution: 'temurin'
- name: Checkout Pull Request Code
uses: actions/checkout@v7
with:
persist-credentials: false
- uses: robinraju/release-downloader@28fc21f50d76778e7023361aa1f863e717d3d56f # 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 java25
./.ci/validation.sh git-diff