Skip to content
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/code-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Code Check

on:
pull_request:
branches: [ main, master ]
push:
branches: [ main, master ]

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Code style check
run: |
./gradlew spotlessCheck
./gradlew checkstyleMain

- name: Run tests with coverage
run: ./gradlew test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./build/reports/jacoco/test/jacocoTestReport.xml
flags: unittests
fail_ci_if_error: true
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
.idea
.gradle
.vscode
*.iml
**/.DS_Store
**/build/*
**/bin/*
**/obj/*

# Compiled class file
*.class

Expand All @@ -12,13 +21,19 @@

# Package Files #
*.jar
!gradle/wrapper/gradle-wrapper.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# Log file
*.log
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

# BlueJ files
*.ctxt
51 changes: 51 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## Environment Setup

Ensure your development environment has:
- JDK 1.8 (Java 8)
- Gradle 8.x

## Building the Project

After cloning the project, run in the project root:

```shell
./gradlew build
```

## IDE Setup

IntelliJ IDEA is recommended. When importing the project, select import as a Gradle project.

## Code Style

This project follows Google Java Style guidelines. In IntelliJ IDEA:

1. Install the google-java-format plugin
2. Enable google-java-format in settings

## Git Hooks

We use the Gradle spotless plugin to ensure code quality. The project is configured to run checks automatically before each commit.

To manually format code, run:

```shell
./gradlew spotlessApply
```

## Dependency Management

This project uses Gradle for dependency management. To add new dependencies, modify the `build.gradle` file.

Example:
```groovy
dependencies {
implementation 'com.example:library:1.0.0'
}
```

Make sure to run tests before committing:

```shell
./gradlew test
```
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 coze-dev
Copyright (c) 2023 Spring (SG) Pte. Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
Loading