Skip to content

Commit

Permalink
ci: fix google-java-format
Browse files Browse the repository at this point in the history
  • Loading branch information
jokerttu committed Sep 3, 2024
1 parent f9e401c commit b54f0e2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,33 @@ jobs:
uses: actions/checkout@v4

- name: Install clang-format and google-java-format
run: sudo apt-get install clang-format-18 google-java-format
run: sudo apt-get install clang-format

- name: Check Objective-C formatting
run: ./scripts/format-objc.sh --check

- name: Install JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
java-package: 'jdk'

- name: Download google-java-format
run: |
GOOGLE_JAVA_FORMAT_VERSION=1.23.0
GOOGLE_JAVA_FORMAT_URL=https://github.com/google/google-java-format/releases/download/v${GOOGLE_JAVA_FORMAT_VERSION}/google-java-format-${GOOGLE_JAVA_FORMAT_VERSION}-all-deps.jar
mkdir -p $HOME/google-java-format
curl -L -o $HOME/google-java-format/google-java-format.jar $GOOGLE_JAVA_FORMAT_URL
- name: Create google-java-format wrapper script
run: |
cat << 'EOF' > /usr/local/bin/google-java-format
#!/bin/sh
exec java -jar "$HOME/google-java-format/google-java-format.jar" "$@"
EOF
chmod +x /usr/local/bin/google-java-format
- name: Check Java formatting
run: ./scripts/format-java.sh --check

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ This project follows
- [git](https://git-scm.com) (used for source version control).
- An IDE such as [Android Studio](https://developer.android.com/studio) or [Visual Studio Code](https://code.visualstudio.com/).
- [addlicense](https://github.com/google/addlicense)
- [google-java-format](https://github.com/google/google-java-format) (used to format Java code).
- [clang-format v18](https://clang.llvm.org/docs/ClangFormat.html) (used to format Objective-C code).
- [google-java-format Version 1.23.0](https://github.com/google/google-java-format) (used to format Java code).
- [clang-format](https://clang.llvm.org/docs/ClangFormat.html) (used to format Objective-C code).

## 2. Forking & cloning the repository

Expand Down

0 comments on commit b54f0e2

Please sign in to comment.