Skip to content

feat: add metrics for spring rest client #58

feat: add metrics for spring rest client

feat: add metrics for spring rest client #58

Workflow file for this run

name: Run build, test and sonar checks
on:
pull_request:
branches:
- develop
push:
branches:
- feature/*
- develop
jobs:
build:
name: Gradle Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 21
distribution: 'adopt'
- name: Run build with gradle
run: ./gradlew clean build -x test
continue-on-error: false
test:
name: Gradle Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 21
distribution: 'adopt'
- name: Run tests with gradle
run: ./gradlew clean test
continue-on-error: false
sonarcloud-scan:
name: SonarCloud Scan
needs: [build, test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 21
distribution: 'adopt'
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew clean build jacocoTestReport sonar --info
continue-on-error: false
open_pull_request:
name: Open Pull Request
needs: [sonarcloud-scan]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Extract branch name
shell: bash
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
- name: Create Pull Request
uses: repo-sync/pull-request@v2
with:
source_branch: "${{ github.ref }}"
destination_branch: ${{ startsWith(github.ref, 'refs/heads/feature/') && 'develop' || 'main' }}
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_title: "Automated PR from ${{ env.BRANCH_NAME }}"
pr_body: "New changes to ${{ env.BRANCH_NAME }}. Check the files changed and merge if everything is ok."
pr_label: 'automated-pr'