From 171012a98427beda2874d0b2bf26e13b063cafc1 Mon Sep 17 00:00:00 2001 From: Kaiser-Yang <624626089@qq.com> Date: Mon, 15 Jul 2024 17:02:01 +0800 Subject: [PATCH] Add docker creator and format action --- .github/workflows/java-format.yml | 37 +++++++++++++++++++++++++++++++ .gitignore | 3 +++ .gitmodules | 3 +++ 3rdparty/docker-script | 1 + 4 files changed, 44 insertions(+) create mode 100644 .github/workflows/java-format.yml create mode 100644 .gitmodules create mode 160000 3rdparty/docker-script diff --git a/.github/workflows/java-format.yml b/.github/workflows/java-format.yml new file mode 100644 index 0000000..8de266a --- /dev/null +++ b/.github/workflows/java-format.yml @@ -0,0 +1,37 @@ +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 + run: | + if [ -n "$(find . -name '*.java' -print -quit)" ]; then + echo "::set-output name=java_files_exist::true" + else + echo "::set-output name=java_files_exist::false" + 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 + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Apply Google Java Style Format" + token: ${{ secrets.PAT }} diff --git a/.gitignore b/.gitignore index 524f096..8b7dead 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..9967aee --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "3rdparty/docker-script"] + path = 3rdparty/docker-script + url = https://github.com/CMIPT/docker-script.git diff --git a/3rdparty/docker-script b/3rdparty/docker-script new file mode 160000 index 0000000..934e238 --- /dev/null +++ b/3rdparty/docker-script @@ -0,0 +1 @@ +Subproject commit 934e238510d11617dfdb89ea28f5acd941db74cd