Skip to content

Validate-user-can-register-a-component-when-calling-the-endpoint-in-component-catalog #52

Validate-user-can-register-a-component-when-calling-the-endpoint-in-component-catalog

Validate-user-can-register-a-component-when-calling-the-endpoint-in-component-catalog #52

Workflow file for this run

name: Build and Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master, develop ]
workflow_dispatch:
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write # For CodeQL
pull-requests: write # For PR comments
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for better analysis
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'gradle'
- name: Grant execute permission for Gradle wrapper
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew clean build --stacktrace --no-daemon
env:
NO_NEXUS: true
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@v2
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=opendevstack
-Dsonar.host.url=https://sonarcloud.io
- name: Publish artifact (JAR)
uses: actions/upload-artifact@v4
with:
name: app-jar
path: build/libs/*.jar
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
**/build/test-results/test/
**/build/reports/jacoco/test/jacocoTestReport.xml
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
**/build/libs/*.jar
retention-days: 7
- name: Upload JAR artifacts
uses: actions/upload-artifact@v4
with:
name: jar-artifacts
path: |
docker/*.jar
**/build/libs/*.jar
retention-days: 30