[v2] Add certifications module implementation #1402
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: "Static Analysis" | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- '.github/**' | |
- 'Source/**' | |
- 'src/**' | |
pull_request: | |
paths: | |
- '.github/**' | |
- 'Source/**' | |
- 'src/**' | |
jobs: | |
sonarcloud: | |
name: SonarCloud | |
if: ${{ github.actor == 'henrikfroehling' }} | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Setup environment variables | |
uses: cardinalby/export-env-action@v2 | |
with: | |
envFile: './.github/constants.env' | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
${{ env.DOTNET_VERSION_STABLE }} | |
${{ env.DOTNET_VERSION_PREVIEW }} | |
- name: Install SonarCloud scanner | |
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' | |
shell: powershell | |
run: | | |
New-Item -Path .\.sonar\scanner -ItemType Directory | |
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner | |
- name: Build and analyze | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
shell: powershell | |
run: | | |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"henrikfroehling_Trakt.NET" /o:"henrikfroehling-github" /n:"Trakt.NET" /d:sonar.exclusions="**/docs/**,**/Tests/**,**/tests/**," /d:sonar.sourceEncoding="UTF-8" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" | |
dotnet build 'Source/Trakt.NET.sln' --configuration Release | |
dotnet build 'src/Trakt.NET.sln' --configuration Release | |
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" |