feat: GH workflow (init)
Some checks failed
Build and Release / Quality gates (push) Failing after 1m27s
Publish Reports to GitHub Pages / Publish static reports (push) Failing after 1s
Build and Release / Publish tagged distribution (push) Has been skipped
Some checks failed
Build and Release / Quality gates (push) Failing after 1m27s
Publish Reports to GitHub Pages / Publish static reports (push) Failing after 1s
Build and Release / Publish tagged distribution (push) Has been skipped
feat: JaCoCo
This commit is contained in:
139
.github/workflows/build.yml
vendored
Normal file
139
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
name: Build and Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
tags:
|
||||
- 'release@*'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- develop
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
quality-gates:
|
||||
name: Quality gates
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Validate Gradle wrapper
|
||||
uses: gradle/actions/wrapper-validation@v4
|
||||
|
||||
- name: Set up Temurin JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '21'
|
||||
|
||||
- name: Set up Gradle caching and instrumentation
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Execute build, tests, PMD, coverage, Javadoc, and distribution packaging
|
||||
run: ./gradlew --no-daemon clean build pmdMain javadoc jacocoTestReport distZip
|
||||
|
||||
- name: Upload test reports
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: test-reports
|
||||
path: |
|
||||
build/reports/tests/test
|
||||
build/test-results/test
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
|
||||
- name: Upload PMD reports
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: pmd-reports
|
||||
path: build/reports/pmd
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
|
||||
- name: Upload coverage reports
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: coverage-reports
|
||||
path: |
|
||||
build/reports/jacoco/test/html
|
||||
build/reports/jacoco/test/jacocoTestReport.xml
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
|
||||
- name: Upload Javadoc
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: javadoc
|
||||
path: build/docs/javadoc
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
|
||||
- name: Upload benchmark reports
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: benchmark-reports
|
||||
path: build/reports/jmh
|
||||
if-no-files-found: ignore
|
||||
retention-days: 14
|
||||
|
||||
- name: Upload distribution archives
|
||||
if: success()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: distributions
|
||||
path: build/distributions/*.zip
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
|
||||
release:
|
||||
name: Publish tagged distribution
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/release@')
|
||||
runs-on: ubuntu-latest
|
||||
needs: quality-gates
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Validate Gradle wrapper
|
||||
uses: gradle/actions/wrapper-validation@v4
|
||||
|
||||
- name: Set up Temurin JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '21'
|
||||
|
||||
- name: Set up Gradle caching and instrumentation
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Build release distribution
|
||||
run: ./gradlew --no-daemon clean build pmdMain javadoc jacocoTestReport distZip
|
||||
|
||||
- name: Publish GitHub release assets
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
generate_release_notes: true
|
||||
files: build/distributions/*.zip
|
||||
Reference in New Issue
Block a user