Skip to content

chore(code-style): verify google code style #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 35 additions & 6 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,43 @@
name: "Pull request"
on:
pull_request:
types: [opened, synchronize, reopened]
types: [ opened, synchronize, reopened ]

jobs:
validation:
name: Gradle Wrapper Validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1

verify-google-java-format:
name: Google Java Format Verification
runs-on: ubuntu-latest
needs: validation
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 15
- name: Cache Gradle
uses: actions/cache@v2
env:
java-version: 15
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ env.java-version }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-${{ env.java-version }}-gradle-
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Gradle Check
run: ./gradlew --info build -x test

test:
name: Test run
strategy:
Expand All @@ -35,18 +64,18 @@ jobs:
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ env.java-version }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-${{ env.java-version }}-gradle-
restore-keys: ${{ runner.os }}-${{ env.java-version }}-gradle-
- name: Make gradlew executable (non-Windows only)
if: matrix.os != 'windows-latest'
run: chmod +x ./gradlew
- name: Gradle Check (non-Windows)
if: matrix.os != 'windows-latest'
run: ./gradlew --info check
run: ./gradlew --info check -x verifyGoogleJavaFormat
- name: Gradle Check (Windows)
if: matrix.os == 'windows-latest'
shell: cmd
run: gradlew --info check
run: gradlew --info check -x verifyGoogleJavaFormat

build:
name: Sonar analysis
needs: validation
Expand Down Expand Up @@ -83,4 +112,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build jacocoTestReport sonarqube --info
run: ./gradlew build jacocoTestReport sonarqube --info -x verifyGoogleJavaFormat
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1

test:
name: Test run
needs: validation
Expand All @@ -34,7 +35,8 @@ jobs:
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Gradle Check
run: ./gradlew --info check
run: ./gradlew --info check -x verifyGoogleJavaFormat

build:
name: Publish release
needs: test
Expand Down
37 changes: 34 additions & 3 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,34 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1

verify-google-java-format:
name: Google Java Format Verification
runs-on: ubuntu-latest
needs: validation
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 15
- name: Cache Gradle
uses: actions/cache@v2
env:
java-version: 15
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-${{ env.java-version }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-${{ env.java-version }}-gradle-
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Gradle Check
run: ./gradlew --info build -x test

test:
name: Test run
needs: validation
Expand All @@ -37,7 +65,8 @@ jobs:
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Gradle Check
run: ./gradlew --info check
run: ./gradlew --info check -x verifyGoogleJavaFormat

build:
name: Publish snapshot
needs: test
Expand Down Expand Up @@ -68,7 +97,8 @@ jobs:
env:
OSS_USER_TOKEN_KEY: ${{ secrets.OSS_USER_TOKEN_KEY }}
OSS_USER_TOKEN_PASS: ${{ secrets.OSS_USER_TOKEN_PASS }}
run: ./gradlew clean build publish -x test
run: ./gradlew clean build publish -x test verifyGoogleJavaFormat

sonar:
name: Sonar analysis
needs: validation
Expand Down Expand Up @@ -98,4 +128,5 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build jacocoTestReport sonarqube --info
if: env.SONAR_TOKEN != null
run: ./gradlew build jacocoTestReport sonarqube --info -x verifyGoogleJavaFormat
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ build/
*.iml
*.ipr
*.iws
**/.idea/
.idea/*
!.idea/codeStyles/
target/
/out/
.classpath
Expand Down
Loading