Skip to content

Commit

Permalink
Streamlining HTTP client definition in Spring 6, CoApi provides zero …
Browse files Browse the repository at this point in the history
…boilerplate code auto-configuration for more convenient and efficient interface calls.
  • Loading branch information
Ahoo-Wang committed Jan 18, 2024
0 parents commit d43d4df
Show file tree
Hide file tree
Showing 80 changed files with 2,998 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: "\U0001F41B Bug Report"
about: Something isn't working as expected
---

## Bug Report

Before report a bug, make sure you have:

- Searched open and closed [GitHub issues](https://github.com/Ahoo-Wang/CoApi/issues).
- Read documentation: [CoApi Doc](https://github.com/Ahoo-Wang/CoApi/).

Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore and we cannot reproduce it on current information, we will **close it**.

Please answer these questions before submitting your issue. Thanks!

### Which version of CoApi did you use?

### Expected behavior

### Actual behavior

### Reason analyze (If you can)

### Steps to reproduce the behavior

### Example codes for reproduce this issue (such as a github link).
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Fixes #ISSUSE_ID.

Changes proposed in this pull request:
-
-
-
68 changes: 68 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Codecov
on:
push:
paths-ignore:
- 'documentation/**'
- 'example/**'
pull_request:
paths-ignore:
- 'documentation/**'
- 'example/**'
workflow_dispatch:
permissions:
contents: read
issues: read
checks: write
pull-requests: write
env:
CI: GITHUB_ACTIONS
jobs:
codecov:
name: Codecov
runs-on: ubuntu-latest
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout
uses: actions/checkout@master

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
server-id: github
settings-path: ${{ github.workspace }}

- name: Build Code Coverage Report
run: ./gradlew codeCoverageReport --stacktrace

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2.12.0
if: always()
with:
ignore_runs: true
large_files: true
files: |
spring/build/test-results/**/*.xml
spring-boot-starter/build/test-results/**/*.xml
- name: Upload Code Coverage Report to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
# directory: ./build/reports/jacoco/codeCoverageReport/
files: ./code-coverage-report/build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml
path_to_write_report: ./coverage/codecov_report.txt
42 changes: 42 additions & 0 deletions .github/workflows/example-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: Example Test
on:
push:
paths-ignore:
- 'documentation/**'
pull_request:
paths-ignore:
- 'documentation/**'
env:
CI: GITHUB_ACTIONS

jobs:
example-test:
name: Example Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
server-id: github
settings-path: ${{ github.workspace }}

- name: Test Example
run: ./gradlew example-server:clean example-server:check --stacktrace
62 changes: 62 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#
# Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: Integration Test
on:
push:
paths-ignore:
- 'documentation/**'
- 'example/**'
pull_request:
paths-ignore:
- 'documentation/**'
- 'example/**'
env:
CI: GITHUB_ACTIONS

jobs:
spring-test:
name: Spring Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
server-id: github
settings-path: ${{ github.workspace }}

- name: Test Spring
run: ./gradlew spring:clean spring:check --stacktrace

spring-boot-starter-test:
name: Spring Boot Starter Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
server-id: github
settings-path: ${{ github.workspace }}

- name: Test Spring-Boot-Stater
run: ./gradlew spring-boot-starter:clean spring-boot-starter:check --stacktrace
65 changes: 65 additions & 0 deletions .github/workflows/package-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#
# Copyright [2021-present] [ahoo wang <ahoowang@qq.com> (https://github.com/Ahoo-Wang)].
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: Packages Deploy
on:
release:
types: [created]
workflow_dispatch:
jobs:
github-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@master

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
server-id: github
settings-path: ${{ github.workspace }}

- name: Publish package
run: ./gradlew publishAllPublicationsToGitHubPackagesRepository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SIGNING_KEYID: ${{ secrets.SIGNING_KEYID }}
SIGNING_SECRETKEY: ${{ secrets.SIGNING_SECRETKEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
central-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
server-id: github
settings-path: ${{ github.workspace }}

- name: Publish package
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
SIGNING_KEYID: ${{ secrets.SIGNING_KEYID }}
SIGNING_SECRETKEY: ${{ secrets.SIGNING_SECRETKEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.gradle
**/build/
!src/**/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties

# Cache of project
.gradletasknamecache

# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

# Ignore Gradle build output directory
build
10 changes: 10 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/ApiClient.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/CoApi.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/checkstyle-idea.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d43d4df

Please sign in to comment.