diff --git a/.0pdd.yml b/.0pdd.yml new file mode 100644 index 0000000..8d23fe2 --- /dev/null +++ b/.0pdd.yml @@ -0,0 +1,5 @@ +errors: + - # your email +tags: + - pdd + - bug diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml new file mode 100644 index 0000000..4c70bc2 --- /dev/null +++ b/.github/workflows/codecov.yaml @@ -0,0 +1,27 @@ +--- +name: codecov +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] +jobs: + codecov: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: 17 + - uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + maven- + - run: mvn clean install + - uses: codecov/codecov-action@v3 + with: + files: ./target/site/jacoco/jacoco.xml + fail_ci_if_error: true diff --git a/.github/workflows/mvn.yaml b/.github/workflows/mvn.yaml new file mode 100644 index 0000000..145b232 --- /dev/null +++ b/.github/workflows/mvn.yaml @@ -0,0 +1,30 @@ +--- +name: mvn +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + test: + name: Tests + strategy: + matrix: + os: [ubuntu-20.04, macos-12] + java: [11, 17] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + - uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-jdk-${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-jdk-${{ matrix.java }}-maven- + - run: mvn clean install --errors --batch-mode diff --git a/.github/workflows/pdd.yaml b/.github/workflows/pdd.yaml new file mode 100644 index 0000000..cc8c149 --- /dev/null +++ b/.github/workflows/pdd.yaml @@ -0,0 +1,10 @@ +name: pdd +on: + push: + pull_request: +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: g4s8/pdd-action@master diff --git a/.github/workflows/xcop.yaml b/.github/workflows/xcop.yaml new file mode 100644 index 0000000..5682297 --- /dev/null +++ b/.github/workflows/xcop.yaml @@ -0,0 +1,15 @@ +--- +name: xcop +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + xcop: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - uses: g4s8/xcop-action@master diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..629fde0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# for IntelliJidea users +.idea + +**/.DS_Store + +target diff --git a/.pdd b/.pdd new file mode 100644 index 0000000..31683a6 --- /dev/null +++ b/.pdd @@ -0,0 +1,4 @@ +--source=. +--verbose +--exclude target/** +--rule min-words:10 diff --git a/.rultor.yml b/.rultor.yml new file mode 100644 index 0000000..9f071ac --- /dev/null +++ b/.rultor.yml @@ -0,0 +1,11 @@ +architect: + - # your GitHub nickname +merge: + script: + - "mvn clean install --errors --batch-mode" +release: + pre: false + script: |- + [[ "${tag}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit -1 + git commit -am "${tag}" + # add your release pipeline diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4821d65 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Ivan Ivanchuk + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..e21c9a6 --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +# elegant +This is a pre-configured template for your projects in Java, you can use it with any language, [more about it](https://h1alexbel.github.io/2023/01/21/maintainable-project-template.html) + +## Tools: + - [Rultor](https://www.rultor.com/) for CI/CD. + - [0pdd](https://www.0pdd.com/) for issue management. + - [Renovate](https://www.mend.io/free-developer-tools/renovate/) for dependency control. + - [xcop](https://www.yegor256.com/2017/08/29/xcop.html) GitHub action for XML style check. + +## How to use? + - Configure actions in `workflows` folder. + - [Configure](https://doc.rultor.com/reference.html) the `@rultor`. + - [Configure](https://www.yegor256.com/2017/04/05/pdd-in-action.html) the `0pdd`. + - [Configure](https://github.com/marketplace/renovate) the `renovate`. + +And you're good to go! diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..39a2b6e --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:base" + ] +}