Skip to content

STNG-145 Add SonarCloud Analysis #468

STNG-145 Add SonarCloud Analysis

STNG-145 Add SonarCloud Analysis #468

Workflow file for this run

name: Conformance-Gateway CI
on:
workflow_dispatch:
push:
branches:
- dev
- test
- master
pull_request:
branches:
- dev
- test
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: Conformance-Gateway
submodules: recursive
- name: Set up Java JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 21
cache: 'maven'
- name: Print commit sha
shell: bash
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
run: |
echo "sha: $COMMIT_SHA"
- name: Build and test Conformance-Gateway
run: |
cd Conformance-Gateway
mvn verify -U -B -V --fail-at-end
- name: Run SonarCloud analysis
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # SonarCloud
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # SonarCloud
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
cd Conformance-Gateway
mvn install -B -DskipTests
mvn sonar:sonar -B -Dsonar.branch.name=$BRANCH_NAME