Files
CloudflareDNS-java/.github/workflows/build-and-test.yml
T
thischwa e77b392ffd Update workflow to rename job and fix Sonar project key
Renamed the `mvn-test` job to `mvn-sonar` for better clarity and alignment with its purpose. Additionally, corrected a typo in the Sonar project key to ensure accurate project identification.
2025-03-24 15:23:47 +01:00

36 lines
1.0 KiB
YAML

name: Build and Test
on:
push:
branches:
- develop
- feature*
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
mvn-sonar:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4.5.0
with:
java-version: '17'
distribution: 'corretto'
- name: Cache maven repository
uses: actions/cache@v4.2.0
with:
path: ~/.m2/repository
key: maven
restore-keys: maven
- name: Build with Maven verify for sonar
env:
API_EMAIL: ${{ secrets.API_EMAIL }}
API_KEY: ${{ secrets.API_KEY }}
API_TOKEN: ${{ secrets.API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=th-schwarz_CloudflareDNS-java