Skip to content

Commit

Permalink
Add Continuous Integration workflow for automated builds and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
remiceres committed Nov 18, 2024
1 parent f7e84a2 commit a3a3434
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Continuous Integration process
run-name: ${{ github.actor }} has launched CI process on ${{ github.ref_name }}
on:
push:
branches:
- "main"
- "develop"
pull_request:
branches:
- "main"
- "develop"

permissions:
contents: read
issues: read
checks: write
pull-requests: write

jobs:
Continuous-Integration-Actions:
runs-on: self-hosted

env:
PACKAGE_TOKEN: ${{ secrets.JLS_TOKEN }}

steps:
- name: Checkout of head
id: ci-sources-checkout
uses: actions/checkout@v4

- name: Set up JDK 21
id: ci-java-setup
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'

- name: Gradle build
id: ci-gradle-build
run: ./gradlew clean assemble

- name: Gradle tests
run: ./gradlew test

- name: Run Coverage
run: ./gradlew jacocoTestReport

- name: Add coverage to PR
id: jacoco
uses: madrapps/[email protected]
with:
paths: |
**/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 40
min-coverage-changed-files: 60
update-comment: true

- name: Get the Coverage info
run: |
echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}"
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/linux@v2
if: always()
with:
files: |
build/test-results/**/*.xml
- name: Get test artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: Package
path: |
**/build/reports/
**/build/test-results/
- name: Final Step
id: ci-final-step
run: |
echo "This job's status is ${{ job.status }}."
echo "Created jar file(s):"
find ./build -name '*.jar'

0 comments on commit a3a3434

Please sign in to comment.