-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d783c8c
commit b11edc4
Showing
7 changed files
with
224 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,35 +5,110 @@ on: [push] | |
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- name: Checkout the repo | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 1.8 | ||
|
||
- name: Cache Gradle packages | ||
uses: actions/cache@v2 | ||
java-version: '8' | ||
distribution: 'corretto' | ||
|
||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Run Gradle build | ||
run: | | ||
./gradlew build | ||
rm build/reports/jacoco/test/html/jacoco-sessions.html | ||
- name: Publish coverage report | ||
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' }} | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: ${{ runner.os }}-gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
branch: gh-pages | ||
folder: build/reports/jacoco/test/html | ||
target-folder: _coverage | ||
|
||
- name: Extract coverage percent | ||
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' }} | ||
run: | | ||
chmod +x gradlew | ||
- name: Test with Gradle | ||
echo "COVERAGE=$(grep -oP '>\K([0-9]+)(?=%)' build/reports/jacoco/test/html/index.html | head -n 1)" >> $GITHUB_ENV | ||
- name: Generate coverage badge | ||
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' }} | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/coverage.svg | ||
label: coverage | ||
value: ${{ env.COVERAGE }} | ||
value_format: "%d%%" | ||
anybadge_args: 50=red 60=orange 80=yellow 100=green | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Publish badge | ||
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' }} | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages | ||
folder: docs/_badges | ||
target-folder: _badges | ||
clean: false | ||
|
||
result: | ||
if: ${{ always() }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
needs: [build] | ||
|
||
steps: | ||
|
||
- name: Checkout the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get build result | ||
run: | | ||
./gradlew test | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v2 | ||
if [[ ${{ needs.build.result }} == "success" || ${{ needs.build.result }} == "skipped" ]]; then | ||
exit 0 | ||
else | ||
exit 1 | ||
fi | ||
- name: Generate passing badge | ||
if: success() | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/build.svg | ||
label: build | ||
value: passing | ||
color: green | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Generate failing badge | ||
if: failure() | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/build.svg | ||
label: build | ||
value: failing | ||
color: red | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Publish badge | ||
if: success() || failure() | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./build/reports/jacoco/test/jacocoTestReport.xml | ||
verbose: true | ||
branch: gh-pages | ||
folder: docs/_badges | ||
target-folder: _badges | ||
clean: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,8 @@ name: documentation | |
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- develop | ||
|
||
jobs: | ||
documentation: | ||
|
@@ -12,40 +13,83 @@ jobs: | |
steps: | ||
|
||
- name: Checkout the repo | ||
uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 1.8 | ||
|
||
- name: Cache Gradle packages | ||
uses: actions/cache@v2 | ||
java-version: '8' | ||
distribution: 'corretto' | ||
|
||
- name: Validate Gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Generate javadoc | ||
run: ./gradlew javadoc | ||
|
||
- name: Publish docs | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: ${{ runner.os }}-gradle | ||
|
||
- name: Grant execute permission for gradlew | ||
run: | | ||
chmod +x gradlew | ||
- name: Generate documentation with Gradle | ||
run: | | ||
./gradlew javadoc | ||
branch: gh-pages | ||
folder: docs/javadoc | ||
clean-exclude: | | ||
_badges | ||
_coverage | ||
- name: Commit documentation changes | ||
- name: Extract project version | ||
run: | | ||
git add -f docs/ | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git commit -m "Automated documentation updates" | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
echo "VERSION=$(grep -oP 'version = "\K([0-9\.]+)(?=")' build.gradle)" >> $GITHUB_ENV | ||
- name: Generate version badge | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/version.svg | ||
label: version | ||
value: v${{ env.VERSION }} | ||
color: teal | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Generate license badge | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/license.svg | ||
label: license | ||
value: BSD-3-Clause | ||
color: yellowgreen | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Generate passing badge | ||
if: success() | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/documentation.svg | ||
label: docs | ||
value: passing | ||
color: green | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Generate failing badge | ||
if: failure() | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/documentation.svg | ||
label: docs | ||
value: failing | ||
color: red | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Publish badge | ||
if: success() || failure() | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} | ||
branch: gh-pages | ||
folder: docs/_badges | ||
target-folder: _badges | ||
clean: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,9 +15,40 @@ jobs: | |
fetch-depth: 0 | ||
|
||
- name: Lint code base | ||
uses: dbelyaev/action-checkstyle@master | ||
uses: dbelyaev/action-checkstyle@v0.9.5 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
reporter: github-check | ||
checkstyle_config: .github/config/checks.xml | ||
fail_on_error: true | ||
|
||
- name: Generate passing badge | ||
if: success() | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/lint.svg | ||
label: lint | ||
value: passing | ||
color: green | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Generate failing badge | ||
if: failure() | ||
uses: knightdave/[email protected] | ||
with: | ||
file: docs/_badges/lint.svg | ||
label: lint | ||
value: failing | ||
color: red | ||
template: docs/_badges/template.svg | ||
overwrite: true | ||
|
||
- name: Publish badge | ||
if: success() || failure() | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
branch: gh-pages | ||
folder: docs/_badges | ||
target-folder: _badges | ||
clean: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
bin/ | ||
lib/ | ||
build/ | ||
docs/ | ||
docs/javadoc | ||
working/ | ||
.DS_Store | ||
MANIFEST.MF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ plugins { | |
id "jacoco" | ||
} | ||
|
||
version = "3.1" | ||
version = "3.1.1" | ||
sourceCompatibility = 1.8 | ||
|
||
repositories { | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.