👮 Integrated sonar cloud #23
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build test and analyze | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
types: | |
- opened | |
- reopened | |
- edited | |
- synchronize | |
jobs: | |
# Build test and analyze source code | |
build_test_analyze: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
java-version: [ 21 ] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
# Setup OpenJDK | |
- name: Setup OpenJDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'adopt' | |
java-version: ${{ matrix.java-version }} | |
# Install dependencies | |
- name: Install dependencies | |
run: | | |
sudo apt remove -y --purge dotnet-sdk-6* dotnet-hostfxr-6* dotnet-sdk-7* dotnet-hostfxr-7* dotnet-host-7* | |
wget https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb -O packages-microsoft-prod.deb | |
sudo apt-get autoremove -y && sudo apt-get autoclean && sudo dpkg -i packages-microsoft-prod.deb && sudo apt-get update | |
sudo apt install -y dotnet-host-7.0 | |
sudo apt install -y make dotnet-sdk-6.0 dotnet-sdk-7.0 dotnet-sdk-8.0 python3-pip python3-rpm python3-psycopg2 | |
pip install 'python-keycloak==3.3.0' --user | |
dotnet tool install --global dotnet-sonarscanner | |
dotnet tool install --global Cake.Tool | |
dotnet tool install --global JetBrains.dotCover.GlobalTool --version 2022.1.2 | |
# Build test and analyze the project | |
- name: Build test and analyze the project | |
if: success() | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
# Copy Licence | |
cp LICENSE NETCore.Keycloak.Client/ | |
# Build, test and analyze project with keycloak version 20 | |
cd NETCore.Keycloak.Client.Tests | |
dotnet cake build_test_analyse.cake --kc_major_version=20 --sonar_token=${SONAR_TOKEN} |