Skip to content

Commit

Permalink
init pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
anasoid committed Jan 7, 2025
1 parent 1d82018 commit 7537b11
Showing 1 changed file with 14 additions and 47 deletions.
61 changes: 14 additions & 47 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@


# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name : Java CI with Gradle

on : [ push, pull_request ]

jobs :
build :
jobs:
build:

runs-on : ubuntu-latest

steps :
- name : Checkout
uses : actions/checkout@v4
steps:

- name: Checkout
uses: actions/checkout@v4

- name: Checkout pet clinic
uses: actions/checkout@v4
with:
repository: anasoid/spring-petclinic
path: './petclinic'

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

- name : Cache Sonar
uses : actions/cache@v4
with :
path : |
~/.sonar
key : ${{ runner.os }}-sonar-${{ hashFiles('**/*.gradle*') }}
restore-keys : |
${{ runner.os }}-sonar-
- name : Setup Gradle
uses : gradle/actions/setup-gradle@v4
with :
Expand All @@ -39,36 +39,3 @@ jobs :
- name : Build with Gradle
run : ./gradlew build


- name : Publish Test Report
uses : mikepenz/action-junit-report@v5
with :
report_paths : '**/build/test-results/test/TEST-*.xml'
github_token : ${{ secrets.GITHUB_TOKEN }}

- name : Upload artifact Report
uses : actions/upload-artifact@v4
with :
name : reports
path : '**/build/reports/**'

- name : Run codacy-coverage-reporter
uses : codacy/[email protected]
with :
project-token : ${{ secrets.CODACY_PROJECT_TOKEN }}
# or
# api-token: ${{ secrets.CODACY_API_TOKEN }}
coverage-reports : ${{ github.workspace }}/buildUtils/code-coverage-report/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml

- name : CodeCov
uses : codecov/codecov-action@v5
with :
token : ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files : ${{ github.workspace }}/buildUtils/code-coverage-report/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml # optional
verbose : true

- name : Sonar check
run : ./gradlew sonar
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}

0 comments on commit 7537b11

Please sign in to comment.