From ee9f59e9c2b47df9e364498113db832b1450c67f Mon Sep 17 00:00:00 2001 From: ForAeons Date: Sat, 17 Feb 2024 12:57:09 +0800 Subject: [PATCH 1/4] Add precommit, prepush hooks and test workflow --- .github/workflows/test.yml | 26 ++++++++++++++++++++++++++ captaingithook.json | 6 ++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/test.yml create mode 100755 captaingithook.json diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000000..03b9255656b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,26 @@ +name: JUnit Test + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: "11" + distribution: "adopt" + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build with Gradle + run: ./gradlew build + + - name: Run JUnit Tests + run: ./gradlew test \ No newline at end of file diff --git a/captaingithook.json b/captaingithook.json new file mode 100755 index 00000000000..169119b437a --- /dev/null +++ b/captaingithook.json @@ -0,0 +1,6 @@ +{ + "hooks": { + "pre-commit": "./gradlew build", + "pre-push": "./gradlew test" + } +} \ No newline at end of file From f1ac6c0f3ed3414c5970d59461d97da8e563c095 Mon Sep 17 00:00:00 2001 From: ForAeons Date: Sat, 17 Feb 2024 12:59:09 +0800 Subject: [PATCH 2/4] Update gitignore to exclude build files and vscode config --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index eab4c7db6a5..66d7a54d25e 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,14 @@ hs_err_pid[0-9]*.log # Test sandbox files src/test/data/sandbox/ +# Build files +bin/ +bin/** + +# vscode files +.vscode/ +.vscode/** + # MacOS custom attributes files created by Finder .DS_Store docs/_site/ From c07cb3c4768d26eb60156a051bc3af7d090f5a83 Mon Sep 17 00:00:00 2001 From: ForAeons Date: Sat, 17 Feb 2024 13:00:54 +0800 Subject: [PATCH 3/4] Add newline to end of file in test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 03b9255656b..54a9e33a613 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,4 +23,4 @@ jobs: run: ./gradlew build - name: Run JUnit Tests - run: ./gradlew test \ No newline at end of file + run: ./gradlew test From fe66aa5c5574eacec8b2842610419bdb321f810b Mon Sep 17 00:00:00 2001 From: ForAeons Date: Sat, 17 Feb 2024 13:02:10 +0800 Subject: [PATCH 4/4] Add newline to end of file of githook.json --- captaingithook.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/captaingithook.json b/captaingithook.json index 169119b437a..2bfb65e7afa 100755 --- a/captaingithook.json +++ b/captaingithook.json @@ -3,4 +3,4 @@ "pre-commit": "./gradlew build", "pre-push": "./gradlew test" } -} \ No newline at end of file +}