Skip to content

Commit 5266671

Browse files
authored
[Infra] Simplify format check (#7310)
Spotless runs fast enough over all the repo that there's no need to have a complex CI setup.
1 parent ffad30a commit 5266671

File tree

1 file changed

+2
-46
lines changed

1 file changed

+2
-46
lines changed

.github/workflows/check_format.yml

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,13 @@ on:
99
- main
1010

1111
jobs:
12-
determine_changed:
13-
name: "Determine changed modules"
14-
runs-on: ubuntu-22.04
15-
if: (github.repository == 'Firebase/firebase-android-sdk' && github.event_name == 'push') || github.event_name == 'pull_request'
16-
outputs:
17-
modules: ${{ steps.changed-modules.outputs.modules }}
18-
steps:
19-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20-
with:
21-
fetch-depth: 2
22-
submodules: true
23-
24-
- name: Set up JDK 17
25-
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
26-
with:
27-
java-version: 17
28-
distribution: temurin
29-
cache: gradle
30-
31-
- id: changed-modules
32-
run: |
33-
git diff --name-only HEAD~1 | xargs printf -- '--changed-git-paths %s\n' | xargs ./gradlew writeChangedProjects --output-file-path=modules.json
34-
echo modules=$(cat modules.json) >> $GITHUB_OUTPUT
35-
3612
check_format:
3713
name: "Check Format"
3814
runs-on: ubuntu-22.04
39-
needs:
40-
- determine_changed
41-
strategy:
42-
fail-fast: false
43-
matrix:
44-
module: ${{ fromJSON(needs.determine_changed.outputs.modules) }}
4515

4616
steps:
4717
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4818
with:
49-
fetch-depth: 2
5019
submodules: true
5120

5221
- name: Set up JDK 17
@@ -56,18 +25,5 @@ jobs:
5625
distribution: temurin
5726
cache: gradle
5827

59-
- name: ${{ matrix.module }} Check Format
60-
run: |
61-
./gradlew ${{matrix.module}}:spotlessCheck
62-
63-
# A job that fails if any job in the check_format matrix fails,
64-
# to be used as a required check for merging.
65-
check_all:
66-
runs-on: ubuntu-22.04
67-
if: always()
68-
name: Check Format (matrix)
69-
needs: check_format
70-
steps:
71-
- name: Check matrix
72-
if: needs.check_format.result != 'success'
73-
run: exit 1
28+
- name: Run Spotless
29+
run: ./gradlew ${{matrix.module}}:spotlessCheck

0 commit comments

Comments
 (0)