Skip to content
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

Add docker creator and format action #1

Merged
merged 1 commit into from
Jul 15, 2024
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
38 changes: 38 additions & 0 deletions .github/workflows/java-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Google Java Style Format

on:
pull_request:
branches: [ master, develop ]

jobs:
java-formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}

- name: Check for Java files
id: check_java_files
run: |
if [ -n "$(find . -name '*.java' -print -quit)" ]; then
echo "java_files_exist=true" >> $GITHUB_OUTPUT
else
echo "java_files_exist=false" >> $GITHUB_OUTPUT
fi

- name: Google Java Style Format
if: steps.check_java_files.outputs.java_files_exist == 'true'
uses: axel-op/googlejavaformat-action@v3
with:
# --aosp: 4-space indentation
args: "--replace --aosp"
# Can not auto commit, we'll commit manually
skip-commit: true

- name: Commit Changes
if: steps.check_java_files.outputs.java_files_exist == 'true'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Apply Google Java Style Format"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

# root directory for the file explorer
.root/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "3rdparty/docker-script"]
path = 3rdparty/docker-script
url = https://github.com/CMIPT/docker-script.git
1 change: 1 addition & 0 deletions 3rdparty/docker-script
Submodule docker-script added at 934e23